Class MemberBox
java.lang.Object
org.mozilla.javascript.MemberBox
- All Implemented Interfaces:
Serializable
Wrapper class for Method and Constructor instances to cache getParameterTypes() results, recover
from IllegalAccessException in some cases and provide serialization support.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) FunctionasGetterFunction(String name, Scriptable scope) Function returned by calls to __lookupGetter__(package private) FunctionasSetterFunction(String name, Scriptable scope) Function returned by calls to __lookupSetter__(package private) Constructor<?> ctor()(package private) Class<?> (package private) StringgetName()private voidinit(Constructor<?> constructor) private void(package private) Object(package private) booleanisCtor()(package private) booleanisMethod()(package private) booleanisPublic()(package private) booleanisStatic()(package private) Membermember()(package private) Methodmethod()(package private) ObjectnewInstance(Object[] args) private static MemberReads a Method or a Constructor from the stream.private voidprivate static Class<?>[]Reads an array of parameter types from the stream.private static MethodsearchAccessibleMethod(Method method, Class<?>[] params) (package private) StringtoString()private static voidwriteMember(ObjectOutputStream out, Member member) Writes a Constructor or Method object.private voidprivate static voidwriteParameters(ObjectOutputStream out, Class<?>[] parms) Writes an array of parameter types to the stream.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
memberObject
-
argTypes
-
vararg
transient boolean vararg -
asGetterFunction
-
asSetterFunction
-
delegateTo
-
primitives
-
-
Constructor Details
-
MemberBox
MemberBox(Method method) -
MemberBox
MemberBox(Constructor<?> constructor)
-
-
Method Details
-
init
-
init
-
method
Method method() -
ctor
Constructor<?> ctor() -
member
Member member() -
isMethod
boolean isMethod() -
isCtor
boolean isCtor() -
isStatic
boolean isStatic() -
isPublic
boolean isPublic() -
getName
String getName() -
getDeclaringClass
Class<?> getDeclaringClass() -
toJavaDeclaration
String toJavaDeclaration() -
toString
-
asGetterFunction
Function returned by calls to __lookupGetter__ -
asSetterFunction
Function returned by calls to __lookupSetter__ -
invoke
-
newInstance
-
searchAccessibleMethod
-
readObject
- Throws:
IOExceptionClassNotFoundException
-
writeObject
- Throws:
IOException
-
writeMember
Writes a Constructor or Method object.Methods and Constructors are not serializable, so we must serialize information about the class, the name, and the parameters and recreate upon deserialization.
- Throws:
IOException
-
readMember
Reads a Method or a Constructor from the stream.- Throws:
IOExceptionClassNotFoundException
-
writeParameters
Writes an array of parameter types to the stream.Requires special handling because primitive types cannot be found upon deserialization by the default Java implementation.
- Throws:
IOException
-
readParameters
private static Class<?>[] readParameters(ObjectInputStream in) throws IOException, ClassNotFoundException Reads an array of parameter types from the stream.- Throws:
IOExceptionClassNotFoundException
-