diff --git a/src/jse/org/luaj/vm2/lib/jse/JavaArray.java b/src/jse/org/luaj/vm2/lib/jse/JavaArray.java index 8d1ab7ec..a72a228f 100644 --- a/src/jse/org/luaj/vm2/lib/jse/JavaArray.java +++ b/src/jse/org/luaj/vm2/lib/jse/JavaArray.java @@ -29,9 +29,15 @@ import org.luaj.vm2.LuaValue; /** * LuaValue that represents a Java instance of array type. *

- * Can get elements by their integer key index, as well as the length. + * Can get elements by their integer key index, as well as the length. + *

+ * This class is not used directly. + * It is returned by calls to {@link CoerceJavaToLua#coerce(Object)} + * when an array is supplied. + * @see CoerceJavaToLua + * @see CoerceLuaToJava */ -public class JavaArray extends LuaUserdata { +class JavaArray extends LuaUserdata { static final LuaValue LENGTH = valueOf("length"); diff --git a/src/jse/org/luaj/vm2/lib/jse/JavaClass.java b/src/jse/org/luaj/vm2/lib/jse/JavaClass.java index 89f38029..32e12fbb 100644 --- a/src/jse/org/luaj/vm2/lib/jse/JavaClass.java +++ b/src/jse/org/luaj/vm2/lib/jse/JavaClass.java @@ -33,15 +33,21 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import org.luaj.vm2.LuaError; import org.luaj.vm2.LuaValue; -import org.luaj.vm2.Varargs; /** * LuaValue that represents a Java class. *

* Will respond to get() and set() by returning field values, or java methods. + *

+ * This class is not used directly. + * It is returned by calls to {@link CoerceJavaToLua#coerce(Object)} + * when a Class is supplied. + * @see CoerceJavaToLua + * @see CoerceLuaToJava */ -public class JavaClass extends JavaInstance implements CoerceJavaToLua.Coercion { +class JavaClass extends JavaInstance implements CoerceJavaToLua.Coercion { static final Map classes = Collections.synchronizedMap(new HashMap()); diff --git a/src/jse/org/luaj/vm2/lib/jse/JavaConstructor.java b/src/jse/org/luaj/vm2/lib/jse/JavaConstructor.java index 029ec228..4581d353 100644 --- a/src/jse/org/luaj/vm2/lib/jse/JavaConstructor.java +++ b/src/jse/org/luaj/vm2/lib/jse/JavaConstructor.java @@ -37,8 +37,14 @@ import org.luaj.vm2.lib.VarArgFunction; *

* May be called with arguments to return a JavaInstance * created by calling the constructor. + *

+ * This class is not used directly. + * It is returned by calls to {@link JavaClass#new(LuaValue key)} + * when the value of key is "new". + * @see CoerceJavaToLua + * @see CoerceLuaToJava */ -public class JavaConstructor extends JavaMember { +class JavaConstructor extends JavaMember { static final Map constructors = Collections.synchronizedMap(new HashMap()); @@ -71,6 +77,15 @@ public class JavaConstructor extends JavaMember { } } + /** + * LuaValue that represents an overloaded Java constructor. + *

+ * On invocation, will pick the best method from the list, and invoke it. + *

+ * This class is not used directly. + * It is returned by calls to calls to {@link JavaClass#get(LuaValue key)} + * when key is "new" and there is more than one public constructor. + */ static class Overload extends VarArgFunction { final JavaConstructor[] constructors; public Overload(JavaConstructor[] c) { diff --git a/src/jse/org/luaj/vm2/lib/jse/JavaInstance.java b/src/jse/org/luaj/vm2/lib/jse/JavaInstance.java index 0d439147..c8ecdf53 100644 --- a/src/jse/org/luaj/vm2/lib/jse/JavaInstance.java +++ b/src/jse/org/luaj/vm2/lib/jse/JavaInstance.java @@ -31,8 +31,14 @@ import org.luaj.vm2.LuaValue; * LuaValue that represents a Java instance. *

* Will respond to get() and set() by returning field values or methods. + *

+ * This class is not used directly. + * It is returned by calls to {@link CoerceJavaToLua#coerce(Object)} + * when a subclass of Object is supplied. + * @see CoerceJavaToLua + * @see CoerceLuaToJava */ -public class JavaInstance extends LuaUserdata { +class JavaInstance extends LuaUserdata { JavaClass jclass; diff --git a/src/jse/org/luaj/vm2/lib/jse/JavaMember.java b/src/jse/org/luaj/vm2/lib/jse/JavaMember.java index 289c37d8..e4e9b7ed 100644 --- a/src/jse/org/luaj/vm2/lib/jse/JavaMember.java +++ b/src/jse/org/luaj/vm2/lib/jse/JavaMember.java @@ -29,7 +29,14 @@ import org.luaj.vm2.lib.jse.CoerceLuaToJava.Coercion; * Java method or constructor. *

* Primarily handles argument coercion for parameter lists including scoring of compatibility and - * java varargs handling. + * java varargs handling. + *

+ * This class is not used directly. + * It is an abstract base class for {@link JavaConstructor} and {@link JavaMethod}. + * @see JavaConstructor + * @see JavaMethod + * @see CoerceJavaToLua + * @see CoerceLuaToJava */ abstract class JavaMember extends VarArgFunction { diff --git a/src/jse/org/luaj/vm2/lib/jse/JavaMethod.java b/src/jse/org/luaj/vm2/lib/jse/JavaMethod.java index faa48f87..6c28457c 100644 --- a/src/jse/org/luaj/vm2/lib/jse/JavaMethod.java +++ b/src/jse/org/luaj/vm2/lib/jse/JavaMethod.java @@ -31,14 +31,19 @@ import org.luaj.vm2.LuaError; import org.luaj.vm2.LuaFunction; import org.luaj.vm2.LuaValue; import org.luaj.vm2.Varargs; -import org.luaj.vm2.lib.jse.CoerceLuaToJava.Coercion; /** * LuaValue that represents a Java method. *

- * Can be invoked. + * Can be invoked via call(LuaValue...) and related methods. + *

+ * This class is not used directly. + * It is returned by calls to calls to {@link JavaInstance#get(LuaValue key)} + * when a method is named. + * @see CoerceJavaToLua + * @see CoerceLuaToJava */ -public class JavaMethod extends JavaMember { +class JavaMethod extends JavaMember { static final Map methods = Collections.synchronizedMap(new HashMap()); @@ -94,7 +99,11 @@ public class JavaMethod extends JavaMember { /** * LuaValue that represents an overloaded Java method. *

- * On invocation, will pick the best method fromi the list, and invoke it. + * On invocation, will pick the best method from the list, and invoke it. + *

+ * This class is not used directly. + * It is returned by calls to calls to {@link JavaInstance#get(LuaValue key)} + * when an overloaded method is named. */ static class Overload extends LuaFunction {