Package org.mozilla.javascript
Class JavaMembers
java.lang.Object
org.mozilla.javascript.JavaMembers
- Direct Known Subclasses:
JavaMembers_jdk11
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Permissionprivate Class<?> (package private) NativeJavaMethodprivate Map<String, FieldAndMethods> private Map<String, FieldAndMethods> private static final boolean -
Constructor Summary
ConstructorsConstructorDescriptionJavaMembers(Scriptable scope, Class<?> cl) JavaMembers(Scriptable scope, Class<?> cl, boolean includeProtected) -
Method Summary
Modifier and TypeMethodDescriptionprivate static JavaMemberscreateJavaMembers(Scriptable associatedScope, Class<?> cl, boolean includeProtected) private Method[]discoverAccessibleMethods(Class<?> clazz, boolean includeProtected, boolean includePrivate) Retrieves mapping of methods to accessible methods for a class.private voiddiscoverAccessibleMethods(Class<?> clazz, Map<JavaMembers.MethodSignature, Method> map, boolean includeProtected, boolean includePrivate) (package private) voiddiscoverPublicMethods(Class<?> clazz, Map<JavaMembers.MethodSignature, Method> map) private static MemberBoxextractGetMethod(MemberBox[] methods, boolean isStatic) private static MemberBoxextractSetMethod(Class<?> type, MemberBox[] methods, boolean isStatic) private static MemberBoxextractSetMethod(MemberBox[] methods, boolean isStatic) private MemberBoxfindExplicitFunction(String name, boolean isStatic) private static MemberBox(package private) Objectget(Scriptable scope, String name, Object javaObject, boolean isStatic) private Constructor<?>[]getAccessibleConstructors(boolean includePrivate) private Field[]getAccessibleFields(boolean includeProtected, boolean includePrivate) private ObjectgetExplicitFunction(Scriptable scope, String name, Object javaObject, boolean isStatic) (package private) Map<String, FieldAndMethods> getFieldAndMethodsObjects(Scriptable scope, Object javaObject, boolean isStatic) (package private) Object[]getIds(boolean isStatic) private static Object(package private) boolean(package private) static StringjavaSignature(Class<?> type) (package private) static StringliveConnectSignature(Class<?>[] argTypes) (package private) static JavaMemberslookupClass(Scriptable scope, Class<?> dynamicType, Class<?> staticType, boolean includeProtected) (package private) voidput(Scriptable scope, String name, Object javaObject, Object value, boolean isStatic) private voidreflect(Scriptable scope, boolean includeProtected, boolean includePrivate) (package private) static voidregisterMethod(Map<JavaMembers.MethodSignature, Method> map, Method method) (package private) RuntimeExceptionreportMemberNotFound(String memberName)
-
Field Details
-
STRICT_REFLECTIVE_ACCESS
private static final boolean STRICT_REFLECTIVE_ACCESS -
allPermission
-
cl
-
members
-
fieldAndMethods
-
staticMembers
-
staticFieldAndMethods
-
ctors
NativeJavaMethod ctors
-
-
Constructor Details
-
JavaMembers
JavaMembers(Scriptable scope, Class<?> cl) -
JavaMembers
JavaMembers(Scriptable scope, Class<?> cl, boolean includeProtected)
-
-
Method Details
-
has
-
get
-
put
-
getIds
-
javaSignature
-
liveConnectSignature
-
findExplicitFunction
-
getExplicitFunction
private Object getExplicitFunction(Scriptable scope, String name, Object javaObject, boolean isStatic) -
discoverAccessibleMethods
private Method[] discoverAccessibleMethods(Class<?> clazz, boolean includeProtected, boolean includePrivate) Retrieves mapping of methods to accessible methods for a class. In case the class is not public, retrieves methods with same signature as its public methods from public superclasses and interfaces (if they exist). Basically upcasts every method to the nearest accessible method. -
discoverAccessibleMethods
private void discoverAccessibleMethods(Class<?> clazz, Map<JavaMembers.MethodSignature, Method> map, boolean includeProtected, boolean includePrivate) -
discoverPublicMethods
-
registerMethod
-
reflect
-
getAccessibleConstructors
-
getAccessibleFields
-
findGetter
-
extractGetMethod
-
extractSetMethod
-
extractSetMethod
-
getFieldAndMethodsObjects
Map<String,FieldAndMethods> getFieldAndMethodsObjects(Scriptable scope, Object javaObject, boolean isStatic) -
lookupClass
static JavaMembers lookupClass(Scriptable scope, Class<?> dynamicType, Class<?> staticType, boolean includeProtected) -
createJavaMembers
private static JavaMembers createJavaMembers(Scriptable associatedScope, Class<?> cl, boolean includeProtected) -
getSecurityContext
-
reportMemberNotFound
-