diff --git a/src/core/org/luaj/vm2/Globals.java b/src/core/org/luaj/vm2/Globals.java index 68812e59..c1d32466 100644 --- a/src/core/org/luaj/vm2/Globals.java +++ b/src/core/org/luaj/vm2/Globals.java @@ -28,6 +28,7 @@ import java.io.Reader; import org.luaj.vm2.lib.BaseLib; import org.luaj.vm2.lib.DebugLib; +import org.luaj.vm2.lib.IoLib; import org.luaj.vm2.lib.PackageLib; import org.luaj.vm2.lib.ResourceFinder; @@ -37,7 +38,8 @@ import org.luaj.vm2.lib.ResourceFinder; * *
{@code
* Globals globals = JsePlatform.standardGlobals();
@@ -64,30 +66,30 @@ import org.luaj.vm2.lib.ResourceFinder;
* - * There are alternate flows when the direct lua-to-Java bytecode compiling {@link LuaJC} is used. + * There are alternate flows when the direct lua-to-Java bytecode compiling {@link org.luaj.vm2.luajc.LuaJC} is used. *
-* The {@link LoadState} class implements {@link Globals#Undumper} +* The {@link LoadState} class provides the default {@link Globals.Undumper} * which is used to undump a string of bytes that represent a lua binary file -* using either the C-based lua compiler, or luaj's {@link DumpState#dump} function. +* using either the C-based lua compiler, or luaj's +* {@link org.luaj.vm2.compiler.LuaC} compiler. *
* The canonical method to load and execute code is done * indirectly using the Globals: @@ -42,24 +41,27 @@ import org.luaj.vm2.compiler.DumpState; * LuaValue chunk = globasl.load("print('hello, world')", "main.lua"); * chunk.call(); * } -* This should work regardless of which {@link Globals.Compiler} -* has been installed. +* This should work regardless of which {@link Globals.Compiler} or {@link Globals.Undumper} +* have been installed. *
-* By default, when using {@link JsePlatform} or {@JmePlatform} -* to construct globals, the {@link LoadState} is installed -* as the default {@link Globals#undumper}. +* By default, when using {@link org.luaj.vm2.lib.jse.JsePlatform} or +* {@link org.luaj.vm2.lib.jme.JmePlatform} +* to construct globals, the {@link LoadState} default undumper is installed +* as the default {@link Globals.Undumper}. *
* -* A lua binary file is created via {@link DumpState#dump}: +* A lua binary file is created via the {@link org.luaj.vm2.compiler.DumpState} class +: *
{@code
* Globals globals = JsePlatform.standardGlobals();
* Prototype p = globals.compilePrototype(new StringReader("print('hello, world')"), "main.lua");
* ByteArrayOutputStream o = new ByteArrayOutputStream();
-* DumpState.dump(p, o, false);
+* org.luaj.vm2.compiler.DumpState.dump(p, o, false);
* byte[] lua_binary_file_bytes = o.toByteArray();
* }
*
-* The {@link LoadState} may be used directly to undump these bytes:
+* The {@link LoadState}'s default undumper {@link #instance}
+* may be used directly to undump these bytes:
* {@code
* Prototypep = LoadState.instance.undump(new ByteArrayInputStream(lua_binary_file_bytes), "main.lua");
* LuaClosure c = new LuaClosure(p, globals);
@@ -67,20 +69,21 @@ import org.luaj.vm2.compiler.DumpState;
* }
*
*
-* More commonly, the {@link Globals#undumper} may be used to undump them:
+* More commonly, the {@link Globals.Undumper} may be used to undump them:
* {@code
* Prototype p = globals.loadPrototype(new ByteArrayInputStream(lua_binary_file_bytes), "main.lua", "b");
* LuaClosure c = new LuaClosure(p, globals);
* c.call();
* }
*
-* @see LuaCompiler
+* @see Globals.Compiler
+* @see Globals.Undumper
* @see LuaClosure
* @see LuaFunction
-* @see LoadState#compiler
-* @see LoadState#load(InputStream, String, LuaValue)
-* @see LuaC
-* @see LuaJC
+* @see org.luaj.vm2.compiler.LuaC
+* @see org.luaj.vm2.luajc.LuaJC
+* @see Globals#compiler
+* @see Globals#load(InputStream, String, LuaValue)
*/
public class LoadState {
@@ -383,7 +386,7 @@ public class LoadState {
/**
* Load input stream as a lua binary chunk if the first 4 bytes are the lua binary signature.
* @param stream InputStream to read, after having read the first byte already
- * @param name Name to apply to the loaded chunk
+ * @param chunkname Name to apply to the loaded chunk
* @return {@link Prototype} that was loaded, or null if the first 4 bytes were not the lua signature.
* @throws IOException if an IOException occurs
*/
diff --git a/src/core/org/luaj/vm2/LuaBoolean.java b/src/core/org/luaj/vm2/LuaBoolean.java
index 41921741..33103415 100644
--- a/src/core/org/luaj/vm2/LuaBoolean.java
+++ b/src/core/org/luaj/vm2/LuaBoolean.java
@@ -27,7 +27,7 @@ package org.luaj.vm2;
* These instance are not instantiated directly by clients.
* Instead, there are exactly twon instances of this class,
* {@link LuaValue#TRUE} and {@link LuaValue#FALSE}
- * representing the lua values {@code true} and {@link false}.
+ * representing the lua values {@code true} and {@code false}.
* The function {@link LuaValue#valueOf(boolean)} will always
* return one of these two values.
* diff --git a/src/core/org/luaj/vm2/LuaClosure.java b/src/core/org/luaj/vm2/LuaClosure.java index ee8a33a7..9b3036d1 100644 --- a/src/core/org/luaj/vm2/LuaClosure.java +++ b/src/core/org/luaj/vm2/LuaClosure.java @@ -33,11 +33,12 @@ package org.luaj.vm2; * There are three main ways {@link LuaClosure} instances are created: *
- * To construct it directly, the {@link Prototype} is typically created via a compiler such as {@link LuaC}: + * To construct it directly, the {@link Prototype} is typically created via a compiler such as + * {@link org.luaj.vm2.compiler.LuaC}: *
{@code
* String script = "print( 'hello, world' )";
* InputStream is = new ByteArrayInputStream(script.getBytes());
@@ -47,7 +48,7 @@ package org.luaj.vm2;
* f.call();
* }
* - * To construct it indirectly, the {@link Globals#load} method may be used: + * To construct it indirectly, the {@link Globals#load(java.io.Reader, String)} method may be used: *
{@code
* Globals globals = JsePlatform.standardGlobals();
* LuaFunction f = globals.load(new StringReader(script), "script");
@@ -78,7 +79,7 @@ package org.luaj.vm2;
* @see LuaValue#checkclosure()
* @see LuaValue#optclosure(LuaClosure)
* @see LoadState
- * @see LoadState#compiler
+ * @see Globals#compiler
*/
public class LuaClosure extends LuaFunction {
private static final UpValue[] NOUPVALUES = new UpValue[0];
diff --git a/src/core/org/luaj/vm2/LuaError.java b/src/core/org/luaj/vm2/LuaError.java
index 13f52323..37a8df8d 100644
--- a/src/core/org/luaj/vm2/LuaError.java
+++ b/src/core/org/luaj/vm2/LuaError.java
@@ -110,8 +110,7 @@ public class LuaError extends RuntimeException {
/**
* Construct a LuaError with a LuaValue as the message object,
* and level to draw line number information from.
- * @param message message to supply
- * @param level where to supply line info from in call stack
+ * @param message_object message string or object to supply
*/
public LuaError(LuaValue message_object) {
super( message_object.tojstring() );
diff --git a/src/core/org/luaj/vm2/LuaFunction.java b/src/core/org/luaj/vm2/LuaFunction.java
index 0f7c01cc..2730952e 100644
--- a/src/core/org/luaj/vm2/LuaFunction.java
+++ b/src/core/org/luaj/vm2/LuaFunction.java
@@ -21,16 +21,18 @@
******************************************************************************/
package org.luaj.vm2;
+
/**
* Base class for functions implemented in Java.
*
- * Direct subclass include {@link LibFunction} which is the base class for
+ * Direct subclass include {@link org.luaj.vm2.lib.LibFunction}
+ * which is the base class for
* all built-in library functions coded in Java,
* and {@link LuaClosure}, which represents a lua closure
* whose bytecode is interpreted when the function is invoked.
* @see LuaValue
- * @see LibFunction
* @see LuaClosure
+ * @see org.luaj.vm2.lib.LibFunction
*/
abstract
public class LuaFunction extends LuaValue {
diff --git a/src/core/org/luaj/vm2/LuaThread.java b/src/core/org/luaj/vm2/LuaThread.java
index 6e6656ee..a085abee 100644
--- a/src/core/org/luaj/vm2/LuaThread.java
+++ b/src/core/org/luaj/vm2/LuaThread.java
@@ -33,14 +33,12 @@ import java.lang.ref.WeakReference;
*
* The threads must be initialized with the globals, so that
* the global environment may be passed along according to rules of lua.
- * This is done via a call to {@link #setGlobals(LuaValue)}
- * at some point during globals initialization.
- * See {@link BaseLib} for additional documentation and example code.
+ * This is done via the constructor arguments {@link #LuaThread(Globals)} or
+ * {@link #LuaThread(Globals, LuaValue)}.
*
- * The utility classes {@link JsePlatform} and {@link JmePlatform}
- * see to it that this initialization is done properly.
- * For this reason it is highly recommended to use one of these classes
- * when initializing globals.
+ * The utility classes {@link org.luaj.vm2.lib.jse.JsePlatform} and
+ * {@link org.luaj.vm2.lib.jme.JmePlatform}
+ * see to it that this {@link Globals} are initialized properly.
*
* The behavior of coroutine threads matches closely the behavior
* of C coroutine library. However, because of the use of Java threads
@@ -50,17 +48,29 @@ import java.lang.ref.WeakReference;
* to determine if it can ever be resumed. If not, it throws
* {@link OrphanedThread} which is an {@link java.lang.Error}.
* Applications should not catch {@link OrphanedThread}, because it can break
- * the thread safety of luaj.
+ * the thread safety of luaj. The value controlling the polling interval
+ * is {@link #thread_orphan_check_interval} and may be set by the user.
+ *
+ * There are two main ways to abandon a coroutine. The first is to call
+ * {@code yield()} from lua, or equivalently {@link Globals#yield(Varargs)},
+ * and arrange to have it never resumed possibly by values passed to yield.
+ * The second is to throw {@link OrphanedThread}, which should put the thread
+ * in a dead state. In either case all references to the thread must be
+ * dropped, and the garbage collector must run for the thread to be
+ * garbage collected.
+ *
*
* @see LuaValue
- * @see JsePlatform
- * @see JmePlatform
- * @see CoroutineLib
+ * @see org.luaj.vm2.lib.jse.JsePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
+ * @see org.luaj.vm2.lib.CoroutineLib
*/
public class LuaThread extends LuaValue {
+ /** Shared metatable for lua threads. */
public static LuaValue s_metatable;
+ /** The current number of coroutines. Should not be set. */
public static int coroutine_count = 0;
/** Polling interval, in milliseconds, which each thread uses while waiting to
diff --git a/src/core/org/luaj/vm2/LuaValue.java b/src/core/org/luaj/vm2/LuaValue.java
index 20f1d194..c7e3282b 100644
--- a/src/core/org/luaj/vm2/LuaValue.java
+++ b/src/core/org/luaj/vm2/LuaValue.java
@@ -59,7 +59,7 @@ import org.luaj.vm2.Varargs;
* }
* * To supply variable arguments or get multiple return values, use - * {@link invoke(Varargs)} or {@link invokemethod(LuaValue, Varargs)} methods: + * {@link #invoke(Varargs)} or {@link #invokemethod(LuaValue, Varargs)} methods: *
{@code
* LuaValue modf = globals.get("math").get("modf");
* Varargs r = modf.invoke( d );
@@ -77,7 +77,7 @@ import org.luaj.vm2.Varargs;
* }
* For this to work the file must be in the current directory, or in the class path,
* dependening on the platform.
- * See {@link JsePlatform} and {@link JmePlatform} for details.
+ * See {@link org.luaj.vm2.lib.jse.JsePlatform} and {@link org.luaj.vm2.lib.jme.JmePlatform} for details.
* * In general a {@link LuaError} may be thrown on any operation when the * types supplied to any operation are illegal from a lua perspective. @@ -92,19 +92,19 @@ import org.luaj.vm2.Varargs; *
* Predefined constants exist for the standard lua type constants - * {@link #TNIL}, {@link #TBOOLEAN}, {@link TLIGHTUSERDATA}, {@link #TNUMBER}, {@link #TSTRING}, + * {@link #TNIL}, {@link #TBOOLEAN}, {@link #TLIGHTUSERDATA}, {@link #TNUMBER}, {@link #TSTRING}, * {@link #TTABLE}, {@link #TFUNCTION}, {@link #TUSERDATA}, {@link #TTHREAD}, * and extended lua type constants - * {@link TINT}, {@link #TNONE}, {@link TVALUE} + * {@link #TINT}, {@link #TNONE}, {@link #TVALUE} *
* Predefined constants exist for all strings used as metatags: - * {@link #INDEX}, {@link #NEWINDEX}, {@link #CALL}, {@link MODE}, {@link METATABLE}, + * {@link #INDEX}, {@link #NEWINDEX}, {@link #CALL}, {@link #MODE}, {@link #METATABLE}, * {@link #ADD}, {@link #SUB}, {@link #DIV}, {@link #MUL}, {@link #POW}, - * {@link MOD}, {@link #UNM}, {@link #LEN}, {@link #EQ}, {@link #LT}, + * {@link #MOD}, {@link #UNM}, {@link #LEN}, {@link #EQ}, {@link #LT}, * {@link #LE}, {@link #TOSTRING}, and {@link #CONCAT}. * - * @see JsePlatform - * @see JmePlatform + * @see org.luaj.vm2.lib.jse.JsePlatform + * @see org.luaj.vm2.lib.jme.JmePlatform * @see LoadState * @see Varargs */ @@ -292,7 +292,7 @@ public class LuaValue extends Varargs { * @see #toboolean() * @see #checkboolean() * @see #optboolean(boolean) - * @see #TOBOLEAN + * @see #TBOOLEAN */ public boolean isboolean() { return false; } @@ -310,7 +310,7 @@ public class LuaValue extends Varargs { * @return true if this is a {@code function}, otherwise false * @see #isclosure() * @see #checkfunction() - * @see #optfunciton(LuaFunction) + * @see #optfunction(LuaFunction) * @see #TFUNCTION */ public boolean isfunction() { return false; } @@ -426,7 +426,7 @@ public class LuaValue extends Varargs { * @see #isuserdata() * @see #touserdata(Class) * @see #checkuserdata(Class) - * @see #optuserdata(Object,Class) + * @see #optuserdata(Class, Object) * @see #TUSERDATA */ public boolean isuserdata(Class c) { return false; } @@ -444,7 +444,6 @@ public class LuaValue extends Varargs { * @return Value cast to byte if number or string convertible to number, otherwise 0 * @see #toint() * @see #todouble() - * @see #optbyte(byte) * @see #checknumber() * @see #isnumber() * @see #TNUMBER @@ -455,7 +454,6 @@ public class LuaValue extends Varargs { * @return Value cast to char if number or string convertible to number, otherwise 0 * @see #toint() * @see #todouble() - * @see #optchar(char) * @see #checknumber() * @see #isnumber() * @see #TNUMBER @@ -481,7 +479,6 @@ public class LuaValue extends Varargs { * @return Value cast to float if number or string convertible to number, otherwise 0 * @see #toint() * @see #todouble() - * @see #optfloat(float) * @see #checknumber() * @see #isnumber() * @see #TNUMBER @@ -520,7 +517,6 @@ public class LuaValue extends Varargs { * @return Value cast to short if number or string convertible to number, otherwise 0 * @see #toint() * @see #todouble() - * @see #optshort(short) * @see #checknumber() * @see #isnumber() * @see #TNUMBER @@ -609,7 +605,7 @@ public class LuaValue extends Varargs { /** Check that optional argument is a boolean and return its boolean value * @param defval boolean value to return if {@code this} is nil or none - * @return {@code this} cast to boolean if a {@LuaBoolean}, + * @return {@code this} cast to boolean if a {@link LuaBoolean}, * {@code defval} if nil or none, * throws {@link LuaError} otherwise * @throws LuaError if was not a boolean or nil or none. @@ -621,7 +617,7 @@ public class LuaValue extends Varargs { /** Check that optional argument is a closure and return as {@link LuaClosure} *
- * A {@link LuaClosure} is a {@LuaFunction} that executes lua byteccode. + * A {@link LuaClosure} is a {@link LuaFunction} that executes lua byteccode. * @param defval {@link LuaClosure} to return if {@code this} is nil or none * @return {@code this} cast to {@link LuaClosure} if a function, * {@code defval} if nil or none, @@ -836,7 +832,7 @@ public class LuaValue extends Varargs { /** Check that the value is a {@link LuaClosure} , * or throw {@link LuaError} if not *
- * {@link LuaClosure} is a subclass of {@LuaFunction} that interprets lua bytecode. + * {@link LuaClosure} is a subclass of {@link LuaFunction} that interprets lua bytecode. * @return {@code this} cast as {@link LuaClosure} * @throws LuaError if not a {@link LuaClosure} * @see #checkfunction() @@ -876,7 +872,7 @@ public class LuaValue extends Varargs { /** Check that the value is a Globals instance, or throw {@link LuaError} if not *
* {@link Globals} are a special {@link LuaTable} that establish the default global environment. - * @return {@code this} if if an instance fof {@Globals} + * @return {@code this} if if an instance fof {@link Globals} * @throws LuaError if not a {@link Globals} instance. */ public Globals checkglobals() { argerror("globals"); return null; } @@ -1046,8 +1042,10 @@ public class LuaValue extends Varargs { /** * Assert a condition is true, or throw a {@link LuaError} if not + * Returns no value when b is true, throws {@link #error(String)} with {@code msg} as argument + * and does not return if b is false. * @param b condition to test - * @return returns no value when b is true, throws error not return if b is false + * @param msg String message to produce on failure * @throws LuaError if b is not true */ public static void assert_(boolean b,String msg) { if(!b) throw new LuaError(msg); } @@ -1320,7 +1318,7 @@ public class LuaValue extends Varargs { * or {@link #NIL} if there are no more. * @throws LuaError if {@code this} is not a table, or the supplied key is invalid. * @see LuaTable - * @see #inext() + * @see #inext(LuaValue) * @see #valueOf(int) * @see Varargs#arg1() * @see Varargs#arg(int) @@ -1345,10 +1343,10 @@ public class LuaValue extends Varargs { * @param index {@link LuaInteger} value identifying a key to start from, * or {@link #NIL} to start at the beginning * @return {@link Varargs} containing {@code (key,value)} for the next entry, - * or {@link NONE} if there are no more. + * or {@link #NONE} if there are no more. * @throws LuaError if {@code this} is not a table, or the supplied key is invalid. * @see LuaTable - * @see #next() + * @see #next(LuaValue) * @see #valueOf(int) * @see Varargs#arg1() * @see Varargs#arg(int) @@ -1361,7 +1359,6 @@ public class LuaValue extends Varargs { * and this Globals as the environment. This is normally used to iniitalize the * library instance and which may install itself into these globals. * @param library The callable {@link LuaValue} to load into {@code this} - * @param string * @return {@link LuaValue} returned by the initialization call. */ public LuaValue load(LuaValue library) { return library.call(EMPTYSTRING, this); } @@ -1446,7 +1443,7 @@ public class LuaValue extends Varargs { * @see #call() * @see #call(LuaValue,LuaValue) * @see #call(LuaValue, LuaValue, LuaValue) - * @see #invoke(LuaValue) + * @see #invoke(Varargs) * @see #method(String,LuaValue) * @see #method(LuaValue,LuaValue) */ @@ -1480,7 +1477,7 @@ public class LuaValue extends Varargs { * @see #call() * @see #call(LuaValue) * @see #call(LuaValue, LuaValue, LuaValue) - * @see #invoke(LuaValue,LuaValue) + * @see #invoke(LuaValue, Varargs) * @see #method(String,LuaValue,LuaValue) * @see #method(LuaValue,LuaValue,LuaValue) */ @@ -1508,7 +1505,7 @@ public class LuaValue extends Varargs { * @see #call() * @see #call(LuaValue) * @see #call(LuaValue, LuaValue) - * @see #invoke(LuaValue,LuaValue, LuaValue) + * @see #invoke(LuaValue, LuaValue, Varargs) * @see #invokemethod(String,Varargs) * @see #invokemethod(LuaValue,Varargs) */ @@ -1586,9 +1583,9 @@ public class LuaValue extends Varargs { * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call(LuaValue) - * @see #invoke(LuaValue) - * @see #method(LuaValue,LuaValue) + * @see #invoke(Varargs) * @see #method(String) + * @see #method(LuaValue) * @see #method(String,LuaValue,LuaValue) */ public LuaValue method(String name, LuaValue arg) { return this.get(name).call(this,arg); } @@ -1613,7 +1610,7 @@ public class LuaValue extends Varargs { * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call(LuaValue) - * @see #invoke(LuaValue) + * @see #invoke(Varargs) * @see #method(String,LuaValue) * @see #method(LuaValue) * @see #method(LuaValue,LuaValue,LuaValue) @@ -1838,7 +1835,10 @@ public class LuaValue extends Varargs { * @see #invoke() * @see #method(String) * @see #invokemethod(LuaValue) - * @see #invokemethod(String,LuaValue) + * @see #invokemethod(String, LuaValue[]) + * @see #invokemethod(String, Varargs) + * @see #invokemethod(LuaValue, LuaValue[]) + * @see #invokemethod(LuaValue, Varargs) */ public Varargs invokemethod(String name) { return get(name).invoke(this); } @@ -1863,7 +1863,10 @@ public class LuaValue extends Varargs { * @see #invoke() * @see #method(LuaValue) * @see #invokemethod(String) - * @see #invokemethod(LuaValue,LuaValue) + * @see #invokemethod(String, LuaValue[]) + * @see #invokemethod(String, Varargs) + * @see #invokemethod(LuaValue, LuaValue[]) + * @see #invokemethod(LuaValue, Varargs) */ public Varargs invokemethod(LuaValue name) { return get(name).invoke(this); } @@ -1888,8 +1891,11 @@ public class LuaValue extends Varargs { * @see #call() * @see #invoke(Varargs) * @see #method(String) - * @see #invokemethod(LuaValue,Varargs) - * @see #invokemethod(String,LuaValue[]) + * @see #invokemethod(String) + * @see #invokemethod(LuaValue) + * @see #invokemethod(String, LuaValue[]) + * @see #invokemethod(LuaValue, LuaValue[]) + * @see #invokemethod(LuaValue, Varargs) */ public Varargs invokemethod(String name, Varargs args) { return get(name).invoke(varargsOf(this,args)); } @@ -1914,8 +1920,11 @@ public class LuaValue extends Varargs { * @see #call() * @see #invoke(Varargs) * @see #method(String) - * @see #invokemethod(String,Varargs) - * @see #invokemethod(LuaValue,LuaValue[]) + * @see #invokemethod(String) + * @see #invokemethod(LuaValue) + * @see #invokemethod(String, LuaValue[]) + * @see #invokemethod(String, Varargs) + * @see #invokemethod(LuaValue, LuaValue[]) */ public Varargs invokemethod(LuaValue name, Varargs args) { return get(name).invoke(varargsOf(this,args)); } @@ -1940,8 +1949,11 @@ public class LuaValue extends Varargs { * @see #call() * @see #invoke(Varargs) * @see #method(String) - * @see #invokemethod(LuaValue,LuaValue[]) - * @see #invokemethod(String,Varargs) + * @see #invokemethod(String) + * @see #invokemethod(LuaValue) + * @see #invokemethod(String, Varargs) + * @see #invokemethod(LuaValue, LuaValue[]) + * @see #invokemethod(LuaValue, Varargs) * @see LuaValue#varargsOf(LuaValue[]) */ public Varargs invokemethod(String name, LuaValue[] args) { return get(name).invoke(varargsOf(this,varargsOf(args))); } @@ -1967,8 +1979,11 @@ public class LuaValue extends Varargs { * @see #call() * @see #invoke(Varargs) * @see #method(String) - * @see #invokemethod(String,LuaValue[]) - * @see #invokemethod(LuaValue,Varargs) + * @see #invokemethod(String) + * @see #invokemethod(LuaValue) + * @see #invokemethod(String, LuaValue[]) + * @see #invokemethod(String, Varargs) + * @see #invokemethod(LuaValue, Varargs) * @see LuaValue#varargsOf(LuaValue[]) */ public Varargs invokemethod(LuaValue name, LuaValue[] args) { return get(name).invoke(varargsOf(this,varargsOf(args))); } @@ -1989,7 +2004,7 @@ public class LuaValue extends Varargs { /** Unary minus: return negative value {@code (-this)} as defined by lua unary minus operator * @return boolean inverse as {@link LuaBoolean} if boolean or nil, - * numeric inverse as {@LuaNumber} if numeric, + * numeric inverse as {@link LuaNumber} if numeric, * or metatag processing result if {@link #UNM} metatag is defined * @throws LuaError if {@code this} is not a table or string, and has no {@link #UNM} metatag */ @@ -2442,7 +2457,7 @@ public class LuaValue extends Varargs { * @return value of {@code (this % rhs)} if both are numeric, * or {@link LuaValue} if metatag processing occurs * @throws LuaError if either operand is not a number or string convertible to number, - * and neither has the {@link MOD} metatag defined + * and neither has the {@link #MOD} metatag defined * @see #arithmt(LuaValue, LuaValue) */ public LuaValue mod( LuaValue rhs ) { return arithmt(MOD,rhs); } @@ -2956,7 +2971,7 @@ public class LuaValue extends Varargs { * Finds the supplied metatag value and invokes it, * or throws {@link LuaError} if none applies. * @param tag The metatag to look up - * @param rhs The right-hand-side value to perform the operation with + * @param op1 The operand with which to to perform the operation * @return {@link LuaValue} resulting from metatag processing * @throws LuaError if metatag was not defined for either operand, * or if the operands are not the same type, @@ -2983,7 +2998,7 @@ public class LuaValue extends Varargs { * each operand must derive from {@link LuaString}. * * @param rhs The right-hand-side value to perform the comparison with - * @returns int < 0 for {@code (this < rhs)}, int > 0 for {@code (this > rhs)}, or 0 when same string. + * @return int < 0 for {@code (this < rhs)}, int > 0 for {@code (this > rhs)}, or 0 when same string. * @throws LuaError if either operand is not a string */ public int strcmp( LuaValue rhs ) { error("attempt to compare "+typename()); return 0; } @@ -2996,7 +3011,7 @@ public class LuaValue extends Varargs { * each operand must derive from {@link LuaString}. * * @param rhs The right-hand-side value to perform the comparison with - * @returns int < 0 for {@code (this < rhs)}, int > 0 for {@code (this > rhs)}, or 0 when same string. + * @return int < 0 for {@code (this < rhs)}, int > 0 for {@code (this > rhs)}, or 0 when same string. * @throws LuaError if this is not a string */ public int strcmp( LuaString rhs ) { error("attempt to compare "+typename()); return 0; } @@ -3008,7 +3023,7 @@ public class LuaValue extends Varargs { * each operand must derive from {@link LuaString} or {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the operation with - * @returns {@link LuaValue} resulting from concatenation of {@code (this .. rhs)} + * @return {@link LuaValue} resulting from concatenation of {@code (this .. rhs)} * @throws LuaError if either operand is not of an appropriate type, * such as nil or a table */ @@ -3023,7 +3038,7 @@ public class LuaValue extends Varargs { * each operand must derive from {@link LuaString} or {@link LuaNumber}. * * @param lhs The left-hand-side value onto which this will be concatenated - * @returns {@link LuaValue} resulting from concatenation of {@code (lhs .. this)} + * @return {@link LuaValue} resulting from concatenation of {@code (lhs .. this)} * @throws LuaError if either operand is not of an appropriate type, * such as nil or a table * @see #concat(LuaValue) @@ -3039,7 +3054,7 @@ public class LuaValue extends Varargs { * each operand must derive from {@link LuaString} or {@link LuaNumber}. * * @param lhs The left-hand-side value onto which this will be concatenated - * @returns {@link LuaValue} resulting from concatenation of {@code (lhs .. this)} + * @return {@link LuaValue} resulting from concatenation of {@code (lhs .. this)} * @throws LuaError if either operand is not of an appropriate type, * such as nil or a table * @see #concat(LuaValue) @@ -3055,7 +3070,7 @@ public class LuaValue extends Varargs { * each operand must derive from {@link LuaString} or {@link LuaNumber}. * * @param lhs The left-hand-side value onto which this will be concatenated - * @returns {@link LuaValue} resulting from concatenation of {@code (lhs .. this)} + * @return {@link LuaValue} resulting from concatenation of {@code (lhs .. this)} * @throws LuaError if either operand is not of an appropriate type, * such as nil or a table * @see #concat(LuaValue) @@ -3327,7 +3342,6 @@ public class LuaValue extends Varargs { * Get particular metatag, or return {@link LuaValue#NIL} if it doesn't exist * @param tag Metatag name to look up, typically a string such as * {@link LuaValue#INDEX} or {@link LuaValue#NEWINDEX} - * @param reason Description of error when tag lookup fails. * @return {@link LuaValue} for tag {@code reason}, or {@link LuaValue#NIL} */ public LuaValue metatag(LuaValue tag) { @@ -3382,7 +3396,6 @@ public class LuaValue extends Varargs { /** Construct a {@link Varargs} around an array of {@link LuaValue}s. * * @param v The array of {@link LuaValue}s - * @param more {@link Varargs} contain values to include at the end * @return {@link Varargs} wrapping the supplied values. * @see LuaValue#varargsOf(LuaValue, Varargs) * @see LuaValue#varargsOf(LuaValue[], int, int) @@ -3399,7 +3412,7 @@ public class LuaValue extends Varargs { /** Construct a {@link Varargs} around an array of {@link LuaValue}s. * * @param v The array of {@link LuaValue}s - * @param more {@link Varargs} contain values to include at the end + * @param r {@link Varargs} contain values to include at the end * @return {@link Varargs} wrapping the supplied values. * @see LuaValue#varargsOf(LuaValue[]) * @see LuaValue#varargsOf(LuaValue[], int, int, Varargs) @@ -3466,8 +3479,8 @@ public class LuaValue extends Varargs { * This can be used to wrap exactly 2 values, or a list consisting of 1 initial value * followed by another variable list of remaining values. * - * @param v1 First {@link LuaValue} in the {@link Varargs} - * @param v2 {@link LuaValue} supplying the 2rd value, + * @param v First {@link LuaValue} in the {@link Varargs} + * @param r {@link LuaValue} supplying the 2rd value, * or {@link Varargs}s supplying all values beyond the first * @return {@link Varargs} wrapping the supplied values. */ diff --git a/src/core/org/luaj/vm2/OrphanedThread.java b/src/core/org/luaj/vm2/OrphanedThread.java index 668217be..b3c931f1 100644 --- a/src/core/org/luaj/vm2/OrphanedThread.java +++ b/src/core/org/luaj/vm2/OrphanedThread.java @@ -29,7 +29,7 @@ package org.luaj.vm2; * {@link LuaThread} being used as a coroutine that could not possibly be * resumed again because there are no more references to the LuaThread with * which it is associated. Rather than locking up resources forever, this error - * is thrown, and should fall through all the way to the thread's {@link Thread.run}() method. + * is thrown, and should fall through all the way to the thread's {@link Thread#run()} method. *
* Java code mixed with the luaj vm should not catch this error because it may * occur when the coroutine is not running, so any processing done during error diff --git a/src/core/org/luaj/vm2/Prototype.java b/src/core/org/luaj/vm2/Prototype.java index 7a4f0ce3..7b1c03b2 100644 --- a/src/core/org/luaj/vm2/Prototype.java +++ b/src/core/org/luaj/vm2/Prototype.java @@ -29,32 +29,33 @@ package org.luaj.vm2; * and the main data structure for execution of compiled lua bytecode. * *
- * Generally, the {@link Protoytpe} is not constructed directly is an intermediate result - * as lua code is loaded using {@link Globals.load}: + * Generally, the {@link Prototype} is not constructed directly is an intermediate result + * as lua code is loaded using {@link Globals#load(java.io.Reader, String)}: *
{@code
* Globals globals = JsePlatform.standardGlobals();
* globals.load( new StringReader("print 'hello'"), "main.lua" ).call();
* }
*
* - * To create a {@link Prototype} directly, a compiler such as {@link LuaC} may be used: + * To create a {@link Prototype} directly, a compiler such as + * {@link org.luaj.vm2.compiler.LuaC} may be used: *
{@code
* InputStream is = new ByteArrayInputStream("print('hello,world')".getBytes());
* Prototype p = LuaC.instance.compile(is, "script");
* }
*
- * To simplify loading, the {@link Globals#compilePrototype} method may be used:
+ * To simplify loading, the {@link Globals#compilePrototype(java.io.InputStream, String)} method may be used:
* {@code
* Prototype p = globals.compileProtoytpe(is, "script");
* }
*
- * It may also be loaded from a {@link java.io.Reader} :
+ * It may also be loaded from a {@link java.io.Reader} via {@link Globals#compilePrototype(java.io.Reader, String)}:
* {@code
* Prototype p = globals.compileProtoytpe(new StringReader(script), "script");
* }
*
* To un-dump a binary file known to be a binary lua file that has been dumped to a string,
- * the {@link Globals#Undumper} interface may be used:
+ * the {@link Globals.Undumper} interface may be used:
* {@code
* FileInputStream lua_binary_file = new FileInputStream("foo.lc"); // Known to be compiled lua.
* Prototype p = globals.undumper.undump(lua_binary_file, "foo.lua");
@@ -76,8 +77,8 @@ package org.luaj.vm2;
*
* @see LuaClosure
* @see Globals
- * @see Globals#Undumper
- * @see Globasl#Compiler
+ * @see Globals#undumper
+ * @see Globals#compiler
* @see Print#print
*/
diff --git a/src/core/org/luaj/vm2/TailcallVarargs.java b/src/core/org/luaj/vm2/TailcallVarargs.java
index fb0e84aa..69eebc5b 100644
--- a/src/core/org/luaj/vm2/TailcallVarargs.java
+++ b/src/core/org/luaj/vm2/TailcallVarargs.java
@@ -38,7 +38,7 @@ package org.luaj.vm2;
* details of this mechanism, as it is built into the core
* execution framework.
* @see Prototype
- * @see LuaJC
+ * @see org.luaj.vm2.luajc.LuaJC
*/
public class TailcallVarargs extends Varargs {
diff --git a/src/core/org/luaj/vm2/UpValue.java b/src/core/org/luaj/vm2/UpValue.java
index 85cd19f5..8fa8186b 100644
--- a/src/core/org/luaj/vm2/UpValue.java
+++ b/src/core/org/luaj/vm2/UpValue.java
@@ -65,7 +65,7 @@ public final class UpValue {
/**
* Set the value of the upvalue
- * @param the {@link LuaValue} to set it to
+ * @param value the {@link LuaValue} to set it to
*/
public final void setValue( LuaValue value ) {
array[index] = value;
diff --git a/src/core/org/luaj/vm2/Varargs.java b/src/core/org/luaj/vm2/Varargs.java
index 180ecf38..fb012297 100644
--- a/src/core/org/luaj/vm2/Varargs.java
+++ b/src/core/org/luaj/vm2/Varargs.java
@@ -386,11 +386,12 @@ public abstract class Varargs {
* */
public LuaValue checknotnil(int i) { return arg(i).checknotnil(); }
- /** Return argument i as a LuaValue when a user-supplied assertion passes, or throw an error.
+ /** Performs test on argument i as a LuaValue when a user-supplied assertion passes, or throw an error.
+ * Returns normally if the value of {@code test} is {@code true}, otherwise throws and argument error with
+ * the supplied message, {@code msg}.
* @param test user supplied assertion to test against
* @param i the index to report in any error message
* @param msg the error message to use when the test fails
- * @return LuaValue value if the value of {@code test} is {@code true}
* @exception LuaError if the the value of {@code test} is {@code false}
* */
public void argcheck(boolean test, int i, String msg) { if (!test) LuaValue.argerror(i,msg); }
diff --git a/src/core/org/luaj/vm2/compiler/LuaC.java b/src/core/org/luaj/vm2/compiler/LuaC.java
index d255cd6a..8e05ed6c 100644
--- a/src/core/org/luaj/vm2/compiler/LuaC.java
+++ b/src/core/org/luaj/vm2/compiler/LuaC.java
@@ -38,18 +38,18 @@ import org.luaj.vm2.lib.BaseLib;
*
*
* Compiles lua source files into lua bytecode within a {@link Prototype},
- * loads lua binary files directly into a{@link Prototype},
+ * loads lua binary files directly into a {@link Prototype},
* and optionaly instantiates a {@link LuaClosure} around the result
* using a user-supplied environment.
*
*
- * Implements the {@link Globals.Compiler} interface for loading
+ * Implements the {@link org.luaj.vm2.Globals.Compiler} interface for loading
* initialized chunks, which is an interface common to
* lua bytecode compiling and java bytecode compiling.
*
*
* The {@link LuaC} compiler is installed by default by both the
- * {@link JsePlatform} and {@link JmePlatform} classes,
+ * {@link org.luaj.vm2.lib.jse.JsePlatform} and {@link org.luaj.vm2.lib.jme.JmePlatform} classes,
* so in the following example, the default {@link LuaC} compiler
* will be used:
*
{@code
@@ -62,15 +62,14 @@ import org.luaj.vm2.lib.BaseLib;
* LuaC.install(globals);
* }
*
- * @see LuaC#install(Globals)
- * @see Globals#Compiler
- * @see Globals#Loader
- * @see LuaJC
- * @see JsePlatform
- * @see JmePlatform
+ * @see #install(Globals)
+ * @see Globals#compiler
+ * @see Globals#loader
+ * @see org.luaj.vm2.luajc.LuaJC
+ * @see org.luaj.vm2.lib.jse.JsePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
* @see BaseLib
* @see LuaValue
- * @see LuaCompiler
* @see Prototype
*/
public class LuaC extends Constants implements Globals.Compiler, Globals.Loader {
diff --git a/src/core/org/luaj/vm2/lib/BaseLib.java b/src/core/org/luaj/vm2/lib/BaseLib.java
index ba43ee3f..1dfca95f 100644
--- a/src/core/org/luaj/vm2/lib/BaseLib.java
+++ b/src/core/org/luaj/vm2/lib/BaseLib.java
@@ -38,18 +38,18 @@ import org.luaj.vm2.Varargs;
*
* This contains all library functions listed as "basic functions" in the lua documentation for JME.
* The functions dofile and loadfile use the
- * {@link #finder} instance to find resource files.
+ * {@link Globals#finder} instance to find resource files.
* Since JME has no file system by default, {@link BaseLib} implements
* {@link ResourceFinder} using {@link Class#getResource(String)},
* which is the closest equivalent on JME.
* The default loader chain in {@link PackageLib} will use these as well.
*
* To use basic library functions that include a {@link ResourceFinder} based on
- * directory lookup, use {@link JseBaseLib} instead.
+ * directory lookup, use {@link org.luaj.vm2.lib.jse.JseBaseLib} instead.
*
* Typically, this library is included as part of a call to either
- * {@link JsePlatform#standardGlobals()} or
- * {@link JmePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()} or
+ * {@link org.luaj.vm2.lib.jme.JmePlatform#standardGlobals()}
*
{@code
* Globals globals = JsePlatform.standardGlobals();
* globals.get("print").call(LuaValue.valueOf("hello, world"));
@@ -67,12 +67,12 @@ import org.luaj.vm2.Varargs;
* and loaded into the globals table.
*
* This is a direct port of the corresponding library in C.
- * @see JseBaseLib
+ * @see org.luaj.vm2.lib.jse.JseBaseLib
* @see ResourceFinder
- * @see #finder
+ * @see Globals#finder
* @see LibFunction
- * @see JsePlatform
- * @see JmePlatform
+ * @see org.luaj.vm2.lib.jse.JsePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
* @see Lua 5.2 Base Lib Reference
*/
public class BaseLib extends TwoArgFunction implements ResourceFinder {
diff --git a/src/core/org/luaj/vm2/lib/Bit32Lib.java b/src/core/org/luaj/vm2/lib/Bit32Lib.java
index 1f076906..55db4f13 100644
--- a/src/core/org/luaj/vm2/lib/Bit32Lib.java
+++ b/src/core/org/luaj/vm2/lib/Bit32Lib.java
@@ -29,7 +29,7 @@ import org.luaj.vm2.Varargs;
* Subclass of LibFunction that implements the Lua standard {@code bit32} library.
*
* Typically, this library is included as part of a call to either
- * {@link JsePlatform#standardGlobals()} or {@link JmePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()} or {@link org.luaj.vm2.lib.jme.JmePlatform#standardGlobals()}
*
{@code
* Globals globals = JsePlatform.standardGlobals();
* System.out.println( globals.get("bit32").get("bnot").call( LuaValue.valueOf(2) ) );
@@ -47,8 +47,8 @@ import org.luaj.vm2.Varargs;
*
* This has been implemented to match as closely as possible the behavior in the corresponding library in C.
* @see LibFunction
- * @see JsePlatform
- * @see JmePlatform
+ * @see org.luaj.vm2.lib.jse.JsePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
* @see Lua 5.2 Bitwise Operation Lib Reference
*/
public class Bit32Lib extends TwoArgFunction {
diff --git a/src/core/org/luaj/vm2/lib/CoroutineLib.java b/src/core/org/luaj/vm2/lib/CoroutineLib.java
index f4df4be3..6fe7644e 100644
--- a/src/core/org/luaj/vm2/lib/CoroutineLib.java
+++ b/src/core/org/luaj/vm2/lib/CoroutineLib.java
@@ -39,7 +39,7 @@ import org.luaj.vm2.Varargs;
* may not be collected by the garbage collector.
*
* Typically, this library is included as part of a call to either
- * {@link JsePlatform#standardGlobals()} or {@link JmePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()} or {@link org.luaj.vm2.lib.jme.JmePlatform#standardGlobals()}
*
{@code
* Globals globals = JsePlatform.standardGlobals();
* System.out.println( globals.get("coroutine").get("running").call() );
@@ -56,8 +56,8 @@ import org.luaj.vm2.Varargs;
* }
*
* @see LibFunction
- * @see JsePlatform
- * @see JmePlatform
+ * @see org.luaj.vm2.lib.jse.JsePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
* @see Lua 5.2 Coroutine Lib Reference
*/
public class CoroutineLib extends TwoArgFunction {
diff --git a/src/core/org/luaj/vm2/lib/DebugLib.java b/src/core/org/luaj/vm2/lib/DebugLib.java
index a43de6ba..71b13cb2 100644
--- a/src/core/org/luaj/vm2/lib/DebugLib.java
+++ b/src/core/org/luaj/vm2/lib/DebugLib.java
@@ -46,11 +46,12 @@ import org.luaj.vm2.Varargs;
* To do this, it must maintain a separate stack of calls to {@link LuaClosure} and {@link LibFunction}
* instances.
* Especially when lua-to-java bytecode compiling is being used
- * via a {@link LuaCompiler} such as {@link LuaJC},
+ * via a {@link org.luaj.vm2.Globals.Compiler} such as {@link org.luaj.vm2.luajc.LuaJC},
* this cannot be done in all cases.
*
* Typically, this library is included as part of a call to either
- * {@link JsePlatform#debugGlobals()} or {@link JmePlatform#debugGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#debugGlobals()} or
+ * {@link org.luaj.vm2.lib.jme.JmePlatform#debugGlobals()}
*
{@code
* Globals globals = JsePlatform.debugGlobals();
* System.out.println( globals.get("debug").get("traceback").call() );
@@ -71,8 +72,8 @@ import org.luaj.vm2.Varargs;
* in a shared server environment.
*
* @see LibFunction
- * @see JsePlatform
- * @see JmePlatform
+ * @see org.luaj.vm2.lib.jse.JsePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
* @see Lua 5.2 Debug Lib Reference
*/
public class DebugLib extends TwoArgFunction {
diff --git a/src/core/org/luaj/vm2/lib/IoLib.java b/src/core/org/luaj/vm2/lib/IoLib.java
index 5913c049..0c2f88e9 100644
--- a/src/core/org/luaj/vm2/lib/IoLib.java
+++ b/src/core/org/luaj/vm2/lib/IoLib.java
@@ -46,14 +46,14 @@ import org.luaj.vm2.Varargs;
* which are difficult to support properly on JME.
*
* Typically, this library is included as part of a call to either
- * {@link JsePlatform#standardGlobals()} or {@link JmePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()} or {@link org.luaj.vm2.lib.jme.JmePlatform#standardGlobals()}
*
{@code
* Globals globals = JsePlatform.standardGlobals();
* globals.get("io").get("write").call(LuaValue.valueOf("hello, world\n"));
* }
- * In this example the platform-specific {@link JseIoLib} library will be loaded, which will include
- * the base functionality provided by this class, whereas the {@link JsePlatform} would load the
- * {@link JseIoLib}.
+ * In this example the platform-specific {@link org.luaj.vm2.lib.jse.JseIoLib} library will be loaded, which will include
+ * the base functionality provided by this class, whereas the {@link org.luaj.vm2.lib.jse.JsePlatform} would load the
+ * {@link org.luaj.vm2.lib.jse.JseIoLib}.
*
* To instantiate and use it directly,
* link it into your globals table via {@link LuaValue#load(LuaValue)} using code such as:
@@ -67,10 +67,10 @@ import org.luaj.vm2.Varargs;
*
* This has been implemented to match as closely as possible the behavior in the corresponding library in C.
* @see LibFunction
- * @see JsePlatform
- * @see JmePlatform
- * @see JseIoLib
- * @see JmeIoLib
+ * @see org.luaj.vm2.lib.jse.JsePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
+ * @see org.luaj.vm2.lib.jse.JseIoLib
+ * @see org.luaj.vm2.lib.jme.JmeIoLib
* @see http://www.lua.org/manual/5.1/manual.html#5.7
*/
abstract
diff --git a/src/core/org/luaj/vm2/lib/MathLib.java b/src/core/org/luaj/vm2/lib/MathLib.java
index eff32061..6b288875 100644
--- a/src/core/org/luaj/vm2/lib/MathLib.java
+++ b/src/core/org/luaj/vm2/lib/MathLib.java
@@ -51,12 +51,14 @@ import org.luaj.vm2.Varargs;
* hand for JME, so will be slower and less accurate than when executed on the JSE platform.
*
* Typically, this library is included as part of a call to either
- * {@link JsePlatform#standardGlobals()} or {@link JmePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()} or
+ * {@link org.luaj.vm2.lib.jme.JmePlatform#standardGlobals()}
*
{@code
* Globals globals = JsePlatform.standardGlobals();
* System.out.println( globals.get("math").get("sqrt").call( LuaValue.valueOf(2) ) );
* }
- * When using {@link JsePlaform} as in this example, the subclass {@link JseMathLib} will
+ * When using {@link org.luaj.vm2.lib.jse.JsePlatform} as in this example,
+ * the subclass {@link org.luaj.vm2.lib.jse.JseMathLib} will
* be included, which also includes this base functionality.
*
* To instantiate and use it directly,
@@ -73,9 +75,9 @@ import org.luaj.vm2.Varargs;
*
* This has been implemented to match as closely as possible the behavior in the corresponding library in C.
* @see LibFunction
- * @see JsePlatform
- * @see JmePlatform
- * @see JseMathLib
+ * @see org.luaj.vm2.lib.jse.JsePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
+ * @see org.luaj.vm2.lib.jse.JseMathLib
* @see Lua 5.2 Math Lib Reference
*/
public class MathLib extends TwoArgFunction {
diff --git a/src/core/org/luaj/vm2/lib/OsLib.java b/src/core/org/luaj/vm2/lib/OsLib.java
index f9da8719..c55d119d 100644
--- a/src/core/org/luaj/vm2/lib/OsLib.java
+++ b/src/core/org/luaj/vm2/lib/OsLib.java
@@ -55,12 +55,12 @@ import org.luaj.vm2.Varargs;
*
*
* Typically, this library is included as part of a call to either
- * {@link JsePlatform#standardGlobals()} or {@link JmePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()} or {@link org.luaj.vm2.lib.jme.JmePlatform#standardGlobals()}
*
{@code
* Globals globals = JsePlatform.standardGlobals();
* System.out.println( globals.get("os").get("time").call() );
* }
- * In this example the platform-specific {@link JseOsLib} library will be loaded, which will include
+ * In this example the platform-specific {@link org.luaj.vm2.lib.jse.JseOsLib} library will be loaded, which will include
* the base functionality provided by this class.
*
* To instantiate and use it directly,
@@ -74,9 +74,9 @@ import org.luaj.vm2.Varargs;
* }
*
* @see LibFunction
- * @see JseOsLib
- * @see JsePlatform
- * @see JmePlatform
+ * @see org.luaj.vm2.lib.jse.JseOsLib
+ * @see org.luaj.vm2.lib.jse.JsePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
* @see http://www.lua.org/manual/5.1/manual.html#5.8
*/
public class OsLib extends TwoArgFunction {
diff --git a/src/core/org/luaj/vm2/lib/PackageLib.java b/src/core/org/luaj/vm2/lib/PackageLib.java
index 0a76c306..74157fac 100644
--- a/src/core/org/luaj/vm2/lib/PackageLib.java
+++ b/src/core/org/luaj/vm2/lib/PackageLib.java
@@ -51,7 +51,7 @@ import org.luaj.vm2.Varargs;
*
*
Loading
* Typically, this library is included as part of a call to either
- * {@link JsePlatform#standardGlobals()} or {@link JmePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()} or {@link org.luaj.vm2.lib.jme.JmePlatform#standardGlobals()}
* {@code
* Globals globals = JsePlatform.standardGlobals();
* System.out.println( globals.get("require").call"foo") );
@@ -68,13 +68,13 @@ import org.luaj.vm2.Varargs;
* Limitations
* This library has been implemented to match as closely as possible the behavior in the corresponding library in C.
* However, the default filesystem search semantics are different and delegated to the bas library
- * as outlined in the {@link BaseLib} and {@link JseBaseLib} documentation.
+ * as outlined in the {@link BaseLib} and {@link org.luaj.vm2.lib.jse.JseBaseLib} documentation.
*
* @see LibFunction
* @see BaseLib
- * @see JseBaseLib
- * @see JsePlatform
- * @see JmePlatform
+ * @see org.luaj.vm2.lib.jse.JseBaseLib
+ * @see org.luaj.vm2.lib.jse.JsePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
* @see Lua 5.2 Package Lib Reference
*/
public class PackageLib extends TwoArgFunction {
@@ -105,7 +105,7 @@ public class PackageLib extends TwoArgFunction {
/** The table for this package. */
LuaTable package_;
- /** Loader that loads from {@link preload} table if found there */
+ /** Loader that loads from {@code preload} table if found there */
public preload_searcher preload_searcher;
/** Loader that loads as a lua script using the lua path currently in {@link path} */
diff --git a/src/core/org/luaj/vm2/lib/ResourceFinder.java b/src/core/org/luaj/vm2/lib/ResourceFinder.java
index 4774a6db..3a7b38a6 100644
--- a/src/core/org/luaj/vm2/lib/ResourceFinder.java
+++ b/src/core/org/luaj/vm2/lib/ResourceFinder.java
@@ -23,6 +23,8 @@ package org.luaj.vm2.lib;
import java.io.InputStream;
+import org.luaj.vm2.Globals;
+
/**
* Interface for opening application resource files such as scripts sources.
*
@@ -32,15 +34,15 @@ import java.io.InputStream;
*
* The Jme version of base lib {@link BaseLib}
* implements {@link Globals#finder} via {@link Class#getResourceAsStream(String)},
- * while the Jse version {@link JseBaseLib} implements it using {@link java.io.File#File(String)}.
+ * while the Jse version {@link org.luaj.vm2.lib.jse.JseBaseLib} implements it using {@link java.io.File#File(String)}.
*
* The io library does not use this API for file manipulation.
*
* @see BaseLib
* @see Globals#finder
- * @see JseBaseLib
- * @see JmePlatform
- * @see JsePlatform
+ * @see org.luaj.vm2.lib.jse.JseBaseLib
+ * @see org.luaj.vm2.lib.jme.JmePlatform
+ * @see org.luaj.vm2.lib.jse.JsePlatform
*/
public interface ResourceFinder {
diff --git a/src/core/org/luaj/vm2/lib/StringLib.java b/src/core/org/luaj/vm2/lib/StringLib.java
index 86307f99..1189fc7e 100644
--- a/src/core/org/luaj/vm2/lib/StringLib.java
+++ b/src/core/org/luaj/vm2/lib/StringLib.java
@@ -37,7 +37,7 @@ import org.luaj.vm2.compiler.DumpState;
* library.
*
* Typically, this library is included as part of a call to either
- * {@link JsePlatform#standardGlobals()} or {@link JmePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()} or {@link org.luaj.vm2.lib.jme.JmePlatform#standardGlobals()}
*
{@code
* Globals globals = JsePlatform.standardGlobals();
* System.out.println( globals.get("string").get("upper").call( LuaValue.valueOf("abcde") ) );
@@ -55,8 +55,8 @@ import org.luaj.vm2.compiler.DumpState;
*
* This is a direct port of the corresponding library in C.
* @see LibFunction
- * @see JsePlatform
- * @see JmePlatform
+ * @see org.luaj.vm2.lib.jse.JsePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
* @see Lua 5.2 String Lib Reference
*/
public class StringLib extends TwoArgFunction {
diff --git a/src/core/org/luaj/vm2/lib/TableLib.java b/src/core/org/luaj/vm2/lib/TableLib.java
index 03658149..bc613676 100644
--- a/src/core/org/luaj/vm2/lib/TableLib.java
+++ b/src/core/org/luaj/vm2/lib/TableLib.java
@@ -31,7 +31,7 @@ import org.luaj.vm2.Varargs;
*
*
* Typically, this library is included as part of a call to either
- * {@link JsePlatform#standardGlobals()} or {@link JmePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()} or {@link org.luaj.vm2.lib.jme.JmePlatform#standardGlobals()}
*
{@code
* Globals globals = JsePlatform.standardGlobals();
* System.out.println( globals.get("table").get("length").call( LuaValue.tableOf() ) );
@@ -49,8 +49,8 @@ import org.luaj.vm2.Varargs;
*
* This has been implemented to match as closely as possible the behavior in the corresponding library in C.
* @see LibFunction
- * @see JsePlatform
- * @see JmePlatform
+ * @see org.luaj.vm2.lib.jse.JsePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
* @see Lua 5.2 Table Lib Reference
*/
public class TableLib extends TwoArgFunction {
diff --git a/src/core/org/luaj/vm2/lib/VarArgFunction.java b/src/core/org/luaj/vm2/lib/VarArgFunction.java
index f529376a..8e2bd614 100644
--- a/src/core/org/luaj/vm2/lib/VarArgFunction.java
+++ b/src/core/org/luaj/vm2/lib/VarArgFunction.java
@@ -31,7 +31,7 @@ import org.luaj.vm2.Varargs;
* simplifying development.
* All other uses of {@link #call(LuaValue)}, {@link #invoke()},etc,
* are routed through this method by this class,
- * converting arguments to {@linnk Varargs} and
+ * converting arguments to {@link Varargs} and
* dropping or extending return values with {@code nil} values as required.
*
* If between one and three arguments are required, and only one return value is returned,
diff --git a/src/jme/org/luaj/vm2/lib/jme/JmeIoLib.java b/src/jme/org/luaj/vm2/lib/jme/JmeIoLib.java
index 1e135c07..e7cbd3c1 100644
--- a/src/jme/org/luaj/vm2/lib/jme/JmeIoLib.java
+++ b/src/jme/org/luaj/vm2/lib/jme/JmeIoLib.java
@@ -28,6 +28,7 @@ import java.io.OutputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.StreamConnection;
+import org.luaj.vm2.Globals;
import org.luaj.vm2.LuaString;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.lib.IoLib;
@@ -41,7 +42,7 @@ import org.luaj.vm2.lib.LibFunction;
* However, seek is not supported.
*
* Typically, this library is included as part of a call to
- * {@link JmePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jme.JmePlatform#standardGlobals()}
*
{@code
* Globals globals = JmePlatform.standardGlobals();
* globals.get("io").get("write").call(LuaValue.valueOf("hello, world\n"));
@@ -62,9 +63,9 @@ import org.luaj.vm2.lib.LibFunction;
* This has been implemented to match as closely as possible the behavior in the corresponding library in C.
* @see LibFunction
* @see org.luaj.vm2.lib.jse.JsePlatform
- * @see JmePlatform
+ * @see org.luaj.vm2.lib.jme.JmePlatform
* @see IoLib
- * @see JseIoLib
+ * @see org.luaj.vm2.lib.jse.JseIoLib
* @see Lua 5.2 I/O Lib Reference
*/
public class JmeIoLib extends IoLib {
diff --git a/src/jme/org/luaj/vm2/lib/jme/JmePlatform.java b/src/jme/org/luaj/vm2/lib/jme/JmePlatform.java
index 012671a3..c7c8bb66 100644
--- a/src/jme/org/luaj/vm2/lib/jme/JmePlatform.java
+++ b/src/jme/org/luaj/vm2/lib/jme/JmePlatform.java
@@ -21,11 +21,11 @@
******************************************************************************/
package org.luaj.vm2.lib.jme;
-import org.luaj.vm2.compiler.LuaC;
import org.luaj.vm2.Globals;
import org.luaj.vm2.LoadState;
import org.luaj.vm2.LuaThread;
import org.luaj.vm2.LuaValue;
+import org.luaj.vm2.compiler.LuaC;
import org.luaj.vm2.lib.BaseLib;
import org.luaj.vm2.lib.Bit32Lib;
import org.luaj.vm2.lib.CoroutineLib;
@@ -33,10 +33,11 @@ import org.luaj.vm2.lib.DebugLib;
import org.luaj.vm2.lib.MathLib;
import org.luaj.vm2.lib.OsLib;
import org.luaj.vm2.lib.PackageLib;
+import org.luaj.vm2.lib.ResourceFinder;
import org.luaj.vm2.lib.StringLib;
import org.luaj.vm2.lib.TableLib;
-/** The {@link JmePlatform} class is a convenience class to standardize
+/** The {@link org.luaj.vm2.lib.jme.JmePlatform} class is a convenience class to standardize
* how globals tables are initialized for the JME platform.
*
* The JME platform, being limited, cannot implement all libraries in all aspects. The main limitations are
@@ -44,8 +45,8 @@ import org.luaj.vm2.lib.TableLib;
*
* It is used to allocate either a set of standard globals using @@ -79,7 +80,7 @@ import org.luaj.vm2.lib.TableLib; *
*
- * The class ensures that initialization is done in the correct order, - * and that linkage is made to {@link LuaThread#setGlobals(LuaValue)}. - * @see JsePlatform - * @see LoadState + * The class ensures that initialization is done in the correct order. + * + * @see Globals + * @see org.luaj.vm2.lib.jse.JsePlatform */ public class JmePlatform { @@ -99,8 +100,8 @@ public class JmePlatform { * * @return Table of globals initialized with the standard JME libraries * @see #debugGlobals() - * @see JsePlatform - * @see JmePlatform + * @see org.luaj.vm2.lib.jse.JsePlatform + * @see org.luaj.vm2.lib.jme.JmePlatform */ public static Globals standardGlobals() { Globals globals = new Globals(); @@ -118,12 +119,12 @@ public class JmePlatform { return globals; } - /** Create standard globals including the {@link debug} library. + /** Create standard globals including the {@link DebugLib} library. * * @return Table of globals initialized with the standard JSE and debug libraries - * @see #standarsGlobals() - * @see JsePlatform - * @see JmePlatform + * @see #standardGlobals() + * @see org.luaj.vm2.lib.jse.JsePlatform + * @see org.luaj.vm2.lib.jme.JmePlatform * @see DebugLib */ public static Globals debugGlobals() { diff --git a/src/jse/org/luaj/vm2/lib/jse/CoerceJavaToLua.java b/src/jse/org/luaj/vm2/lib/jse/CoerceJavaToLua.java index 8ca3ec36..36c5d824 100644 --- a/src/jse/org/luaj/vm2/lib/jse/CoerceJavaToLua.java +++ b/src/jse/org/luaj/vm2/lib/jse/CoerceJavaToLua.java @@ -33,7 +33,7 @@ import org.luaj.vm2.LuaValue; /** * Helper class to coerce values from Java to lua within the luajava library. *
- * This class is primarily used by the {@link LuajavaLib}, + * This class is primarily used by the {@link org.luaj.vm2.lib.jse.LuajavaLib}, * but can also be used directly when working with Java/lua bindings. *
* To coerce scalar types, the various, generally the {@code valueOf(type)} methods @@ -59,7 +59,7 @@ import org.luaj.vm2.LuaValue; * table, or table of tables. * * @see CoerceJavaToLua#coerce(Object) - * @see LuajavaLib + * @see org.luaj.vm2.lib.jse.LuajavaLib */ public class CoerceJavaToLua { diff --git a/src/jse/org/luaj/vm2/lib/jse/CoerceLuaToJava.java b/src/jse/org/luaj/vm2/lib/jse/CoerceLuaToJava.java index 8abc03b4..c658aacc 100644 --- a/src/jse/org/luaj/vm2/lib/jse/CoerceLuaToJava.java +++ b/src/jse/org/luaj/vm2/lib/jse/CoerceLuaToJava.java @@ -33,7 +33,7 @@ import org.luaj.vm2.LuaValue; /** * Helper class to coerce values from lua to Java within the luajava library. *
- * This class is primarily used by the {@link LuajavaLib}, + * This class is primarily used by the {@link org.luaj.vm2.lib.jse.LuajavaLib}, * but can also be used directly when working with Java/lua bindings. *
* To coerce to specific Java values, generally the {@code toType()} methods @@ -54,7 +54,7 @@ import org.luaj.vm2.LuaValue; * For data in lua tables, the various methods on {@link LuaTable} can be used directly * to convert data to something more useful. * - * @see LuajavaLib + * @see org.luaj.vm2.lib.jse.LuajavaLib * @see CoerceJavaToLua */ public class CoerceLuaToJava { diff --git a/src/jse/org/luaj/vm2/lib/jse/JseBaseLib.java b/src/jse/org/luaj/vm2/lib/jse/JseBaseLib.java index c1aebc28..f460905b 100644 --- a/src/jse/org/luaj/vm2/lib/jse/JseBaseLib.java +++ b/src/jse/org/luaj/vm2/lib/jse/JseBaseLib.java @@ -26,6 +26,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import org.luaj.vm2.Globals; import org.luaj.vm2.LuaValue; import org.luaj.vm2.lib.BaseLib; import org.luaj.vm2.lib.LibFunction; @@ -33,16 +34,16 @@ import org.luaj.vm2.lib.ResourceFinder; /** * Subclass of {@link BaseLib} and {@link LibFunction} which implements the lua basic library functions - * and provides a directory based {@link ResourceFinder} as the {@link #finder}. + * and provides a directory based {@link ResourceFinder} as the {@link Globals#finder}. *
* Since JME has no file system by default, {@link BaseLib} implements * {@link ResourceFinder} using {@link Class#getResource(String)}. - * The {@link JseBaseLib} implements {@link finder} by scanning the current directory + * The {@link org.luaj.vm2.lib.jse.JseBaseLib} implements {@link Globals#finder} by scanning the current directory * first, then falling back to {@link Class#getResource(String)} if that fails. * Otherwise, the behavior is the same as that of {@link BaseLib}. *
* Typically, this library is included as part of a call to - * {@link JsePlatform#standardGlobals()} + * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()} *
{@code
* Globals globals = JsePlatform.standardGlobals();
* globals.get("print").call(LuaValue.valueOf("hello, world"));
@@ -62,9 +63,9 @@ import org.luaj.vm2.lib.ResourceFinder;
* @see Globals
* @see BaseLib
* @see ResourceFinder
- * @see {@link Globals.finder}
+ * @see Globals#finder
* @see LibFunction
- * @see JsePlatform
+ * @see org.luaj.vm2.lib.jse.JsePlatform
* @see org.luaj.vm2.lib.jme.JmePlatform
* @see Lua 5.2 Base Lib Reference
*/
@@ -75,7 +76,7 @@ public class JseBaseLib extends org.luaj.vm2.lib.BaseLib {
/** Perform one-time initialization on the library by creating a table
* containing the library functions, adding that table to the supplied environment,
* adding the table to package.loaded, and returning table as the return value.
- * Specifically, extend the library loading to set the default value for {@link Globals.STDIN}
+ *
Specifically, extend the library loading to set the default value for {@link Globals#STDIN}
* @param modname the module name supplied if this is loaded via 'require'.
* @param env the environment to load into, which must be a Globals instance.
*/
diff --git a/src/jse/org/luaj/vm2/lib/jse/JseIoLib.java b/src/jse/org/luaj/vm2/lib/jse/JseIoLib.java
index bb1caa15..9655de26 100644
--- a/src/jse/org/luaj/vm2/lib/jse/JseIoLib.java
+++ b/src/jse/org/luaj/vm2/lib/jse/JseIoLib.java
@@ -29,6 +29,7 @@ import java.io.OutputStream;
import java.io.PrintStream;
import java.io.RandomAccessFile;
+import org.luaj.vm2.Globals;
import org.luaj.vm2.LuaError;
import org.luaj.vm2.LuaString;
import org.luaj.vm2.LuaValue;
@@ -42,7 +43,7 @@ import org.luaj.vm2.lib.LibFunction;
* It uses RandomAccessFile to implement seek on files.
*
* Typically, this library is included as part of a call to
- * {@link JsePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()}
*
{@code
* Globals globals = JsePlatform.standardGlobals();
* globals.get("io").get("write").call(LuaValue.valueOf("hello, world\n"));
@@ -62,10 +63,10 @@ import org.luaj.vm2.lib.LibFunction;
*
* This has been implemented to match as closely as possible the behavior in the corresponding library in C.
* @see LibFunction
- * @see JsePlatform
+ * @see org.luaj.vm2.lib.jse.JsePlatform
* @see org.luaj.vm2.lib.jme.JmePlatform
* @see IoLib
- * @see JmeIoLib
+ * @see org.luaj.vm2.lib.jme.JmeIoLib
* @see Lua 5.2 I/O Lib Reference
*/
public class JseIoLib extends IoLib {
diff --git a/src/jse/org/luaj/vm2/lib/jse/JseMathLib.java b/src/jse/org/luaj/vm2/lib/jse/JseMathLib.java
index b00e5f41..82799caa 100644
--- a/src/jse/org/luaj/vm2/lib/jse/JseMathLib.java
+++ b/src/jse/org/luaj/vm2/lib/jse/JseMathLib.java
@@ -21,6 +21,7 @@
******************************************************************************/
package org.luaj.vm2.lib.jse;
+import org.luaj.vm2.Globals;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.lib.LibFunction;
@@ -29,10 +30,10 @@ import org.luaj.vm2.lib.LibFunction;
* library.
*
* It contains all lua math functions, including those not available on the JME platform.
- * See {@link org.luaj.lib.MathLib} for the exception list.
+ * See {@link org.luaj.vm2.lib.MathLib} for the exception list.
*
* Typically, this library is included as part of a call to
- * {@link JsePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()}
*
{@code
* Globals globals = JsePlatform.standardGlobals();
* System.out.println( globals.get("math").get("sqrt").call( LuaValue.valueOf(2) ) );
@@ -52,9 +53,9 @@ import org.luaj.vm2.lib.LibFunction;
*
* This has been implemented to match as closely as possible the behavior in the corresponding library in C.
* @see LibFunction
- * @see JsePlatform
+ * @see org.luaj.vm2.lib.jse.JsePlatform
* @see org.luaj.vm2.lib.jme.JmePlatform
- * @see JseMathLib
+ * @see org.luaj.vm2.lib.jse.JseMathLib
* @see Lua 5.2 Math Lib Reference
*/
public class JseMathLib extends org.luaj.vm2.lib.MathLib {
diff --git a/src/jse/org/luaj/vm2/lib/jse/JseOsLib.java b/src/jse/org/luaj/vm2/lib/jse/JseOsLib.java
index c4e54745..eb6c4e78 100644
--- a/src/jse/org/luaj/vm2/lib/jse/JseOsLib.java
+++ b/src/jse/org/luaj/vm2/lib/jse/JseOsLib.java
@@ -24,9 +24,11 @@ package org.luaj.vm2.lib.jse;
import java.io.File;
import java.io.IOException;
+import org.luaj.vm2.Globals;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.Varargs;
import org.luaj.vm2.lib.LibFunction;
+import org.luaj.vm2.lib.OsLib;
/**
* Subclass of {@link LibFunction} which implements the standard lua {@code os} library.
@@ -45,7 +47,7 @@ import org.luaj.vm2.lib.LibFunction;
* from their counterparts in the C platform.
*
* Typically, this library is included as part of a call to
- * {@link JsePlatform#standardGlobals()}
+ * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()}
*
{@code
* Globals globals = JsePlatform.standardGlobals();
* System.out.println( globals.get("os").get("time").call() );
@@ -65,7 +67,7 @@ import org.luaj.vm2.lib.LibFunction;
*
* @see LibFunction
* @see OsLib
- * @see JsePlatform
+ * @see org.luaj.vm2.lib.jse.JsePlatform
* @see org.luaj.vm2.lib.jme.JmePlatform
* @see Lua 5.2 OS Lib Reference
*/
diff --git a/src/jse/org/luaj/vm2/lib/jse/JsePlatform.java b/src/jse/org/luaj/vm2/lib/jse/JsePlatform.java
index c987904e..196ea8ba 100644
--- a/src/jse/org/luaj/vm2/lib/jse/JsePlatform.java
+++ b/src/jse/org/luaj/vm2/lib/jse/JsePlatform.java
@@ -34,7 +34,7 @@ import org.luaj.vm2.lib.ResourceFinder;
import org.luaj.vm2.lib.StringLib;
import org.luaj.vm2.lib.TableLib;
-/** The {@link JsePlatform} class is a convenience class to standardize
+/** The {@link org.luaj.vm2.lib.jse.JsePlatform} class is a convenience class to standardize
* how globals tables are initialized for the JSE platform.
*
* It is used to allocate either a set of standard globals using
@@ -56,29 +56,30 @@ import org.luaj.vm2.lib.TableLib;
* globals.get("require").call(LuaValue.valueOf("main"));
* }
* For this to succeed, the file "main.lua" must be in the current directory or a resource.
- * See {@link JseBaseLib} for details on finding scripts using {@link ResourceFinder}.
+ * See {@link org.luaj.vm2.lib.jse.JseBaseLib} for details on finding scripts using {@link ResourceFinder}.
*
* The standard globals will contain all standard libraries plus {@code luajava}:
*
* The debug globals are simply the standard globals plus the {@code debug} library {@link DebugLib}. *
- * The class ensures that initialization is done in the correct order, - * and that linkage is made to {@link LuaThread#setGlobals(LuaValue)}. - * @see JmePlatform + * The class ensures that initialization is done in the correct order. + * + * @see Globals + * @see org.luaj.vm2.lib.jme.JmePlatform */ public class JsePlatform { @@ -87,8 +88,8 @@ public class JsePlatform { * * @return Table of globals initialized with the standard JSE libraries * @see #debugGlobals() - * @see JsePlatform - * @see JmePlatform + * @see org.luaj.vm2.lib.jse.JsePlatform + * @see org.luaj.vm2.lib.jme.JmePlatform */ public static Globals standardGlobals() { Globals globals = new Globals(); @@ -107,12 +108,12 @@ public class JsePlatform { return globals; } - /** Create standard globals including the {@link debug} library. + /** Create standard globals including the {@link DebugLib} library. * * @return Table of globals initialized with the standard JSE and debug libraries * @see #standardGlobals() - * @see JsePlatform - * @see JmePlatform + * @see org.luaj.vm2.lib.jse.JsePlatform + * @see org.luaj.vm2.lib.jme.JmePlatform * @see DebugLib */ public static Globals debugGlobals() { diff --git a/src/jse/org/luaj/vm2/lib/jse/LuajavaLib.java b/src/jse/org/luaj/vm2/lib/jse/LuajavaLib.java index 46da493e..7b4d16ea 100644 --- a/src/jse/org/luaj/vm2/lib/jse/LuajavaLib.java +++ b/src/jse/org/luaj/vm2/lib/jse/LuajavaLib.java @@ -28,6 +28,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; +import org.luaj.vm2.Globals; import org.luaj.vm2.LuaError; import org.luaj.vm2.LuaTable; import org.luaj.vm2.LuaValue; @@ -45,7 +46,7 @@ import org.luaj.vm2.lib.VarArgFunction; * *
* Typically, this library is included as part of a call to - * {@link JsePlatform#standardGlobals()} + * {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()} *
{@code
* Globals globals = JsePlatform.standardGlobals();
* System.out.println( globals.get("luajava").get("bindClass").call( LuaValue.valueOf("java.lang.System") ).invokeMethod("currentTimeMillis") );
@@ -65,7 +66,7 @@ import org.luaj.vm2.lib.VarArgFunction;
*
*
* The {@code luajava} library is available
- * on all JSE platforms via the call to {@link JsePlatform#standardGlobals()}
+ * on all JSE platforms via the call to {@link org.luaj.vm2.lib.jse.JsePlatform#standardGlobals()}
* and the luajava api's are simply invoked from lua.
* Because it makes extensive use of Java's reflection API, it is not available
* on JME, but can be used in Android applications.
diff --git a/src/jse/org/luaj/vm2/luajc/LuaJC.java b/src/jse/org/luaj/vm2/luajc/LuaJC.java
index c65dc268..4b74ef4f 100644
--- a/src/jse/org/luaj/vm2/luajc/LuaJC.java
+++ b/src/jse/org/luaj/vm2/luajc/LuaJC.java
@@ -27,18 +27,18 @@ import java.io.Reader;
import java.util.Hashtable;
import org.luaj.vm2.Globals;
-import org.luaj.vm2.LoadState;
+import org.luaj.vm2.LuaClosure;
import org.luaj.vm2.LuaFunction;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.Prototype;
import org.luaj.vm2.compiler.LuaC;
-import org.luaj.vm2.lib.BaseLib;
/**
- * Implementation of {@link LuaCompiler} which does direct
+ * Implementation of {@link org.luaj.vm2.Globals.Compiler} which does direct
* lua-to-java-bytecode compiling.
*
- * By default, when using {@link JsePlatform} or {@JmePlatform}
+ * By default, when using {@link org.luaj.vm2.lib.jse.JsePlatform} or
+ * {@link org.luaj.vm2.lib.jme.JmePlatform}
* to construct globals, the plain compiler {@link LuaC} is installed and lua code
* will only be compiled into lua bytecode and execute as {@link LuaClosure}.
*
@@ -57,9 +57,9 @@ import org.luaj.vm2.lib.BaseLib;
* If the library is not found, the default {@link LuaC} lua-to-lua-bytecode
* compiler will be used.
*
- * @see LuaCompiler
- * @see LuaC
- * @see BaseLib
+ * @see Globals#compiler
+ * @see #install(Globals)
+ * @see org.luaj.vm2.compiler.LuaC
* @see LuaValue
*/
public class LuaJC implements Globals.Loader {