Package org.htmlunit.corejs.javascript
Class MemberBox
java.lang.Object
org.htmlunit.corejs.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) Function
asGetterFunction
(String name, Scriptable scope) Function returned by calls to __lookupGetter__(package private) Function
asSetterFunction
(String name, Scriptable scope) Function returned by calls to __lookupSetter__(package private) Constructor
<?> ctor()
(package private) Class
<?> (package private) String
getName()
private void
init
(Constructor<?> constructor) private void
(package private) Object
(package private) boolean
isCtor()
(package private) boolean
isMethod()
(package private) boolean
isPublic()
(package private) boolean
isStatic()
(package private) Member
member()
(package private) Method
method()
(package private) Object
newInstance
(Object[] args) private static Member
Reads a Method or a Constructor from the stream.private void
private static Class<?>[]
Reads an array of parameter types from the stream.private static Method
searchAccessibleMethod
(Method method, Class<?>[] params) (package private) String
toString()
private static void
writeMember
(ObjectOutputStream out, Member member) Writes a Constructor or Method object.private void
private static void
writeParameters
(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:
IOException
ClassNotFoundException
-
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:
IOException
ClassNotFoundException
-
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:
IOException
ClassNotFoundException
-