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 Permission
private Class<?>
(package private) NativeJavaMethod
private 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 JavaMembers
createJavaMembers
(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 void
discoverAccessibleMethods
(Class<?> clazz, Map<JavaMembers.MethodSignature, Method> map, boolean includeProtected, boolean includePrivate) (package private) void
discoverPublicMethods
(Class<?> clazz, Map<JavaMembers.MethodSignature, Method> map) private static MemberBox
extractGetMethod
(MemberBox[] methods, boolean isStatic) private static MemberBox
extractSetMethod
(Class<?> type, MemberBox[] methods, boolean isStatic) private static MemberBox
extractSetMethod
(MemberBox[] methods, boolean isStatic) private MemberBox
findExplicitFunction
(String name, boolean isStatic) private static MemberBox
(package private) Object
get
(Scriptable scope, String name, Object javaObject, boolean isStatic) private Constructor<?>[]
getAccessibleConstructors
(boolean includePrivate) private Field[]
getAccessibleFields
(boolean includeProtected, boolean includePrivate) private Object
getExplicitFunction
(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 String
javaSignature
(Class<?> type) (package private) static String
liveConnectSignature
(Class<?>[] argTypes) (package private) static JavaMembers
lookupClass
(Scriptable scope, Class<?> dynamicType, Class<?> staticType, boolean includeProtected) (package private) void
put
(Scriptable scope, String name, Object javaObject, Object value, boolean isStatic) private void
reflect
(Scriptable scope, boolean includeProtected, boolean includePrivate) (package private) static void
registerMethod
(Map<JavaMembers.MethodSignature, Method> map, Method method) (package private) RuntimeException
reportMemberNotFound
(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
-