|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoscript.data.Value
oscript.data.Type
oscript.data.JavaClassWrapper
A wrapper for a java class. Types should be intern'd.
Nested Class Summary | |
static class |
JavaClassWrapper.Base
For use by test suite... |
static class |
JavaClassWrapper.Derived
|
protected static class |
JavaClassWrapper.JavaClassWrapperImpl
Implements the reflection stuff... |
Field Summary | |
protected JavaClassWrapper.JavaClassWrapperImpl |
impl
|
protected java.lang.Class |
javaClass
|
static java.lang.String[] |
MEMBER_NAMES
|
static java.lang.String |
PARENT_TYPE_NAME
|
static Value |
TYPE
The type object for an script java type. |
static java.lang.String |
TYPE_NAME
|
protected JavaClassWrapper.JavaClassWrapperImpl |
wrapperImpl
|
Fields inherited from class oscript.data.Type |
HIDDEN_TYPE |
Fields inherited from class oscript.data.Value |
DEBUG, NULL, UNDEFINED |
Constructor Summary | |
protected |
JavaClassWrapper(java.lang.Class javaClass)
Class Constructor. |
Method Summary | |
Value |
callAsConstructor(StackFrame sf,
MemberTable args)
Call this object as a constructor. |
Value |
callAsExtends(StackFrame sf,
Scope scope,
MemberTable args)
Call this object as a parent class constructor. |
java.lang.Object |
castToJavaObject()
Convert this object to a native java Object value. |
java.lang.String |
castToString()
Convert this object to a native java String value. |
protected java.lang.Object |
doConstruct(StackFrame sf,
MemberTable args,
boolean isWrapper)
|
static java.lang.Class |
forName(java.lang.String className)
|
java.lang.ClassLoader |
getClassLoader()
Get the ClassLoader object for the java class this class is
a wrapper for. |
static JavaClassWrapper |
getClassWrapper(java.lang.Class javaClass)
The class wrapper instances need to be intern'd, so the types work out right... |
static JavaClassWrapper |
getClassWrapper(java.lang.String className)
|
Value |
getMember(int id,
boolean exception)
Get a member of this object. |
java.lang.String |
getName()
Convert this object to a native java String value. |
protected Value |
getTypeImpl()
Get the type of this object. |
protected Value |
getTypeMember(Value obj,
int id)
Get a member of this type. |
protected Value |
getTypeMemberImpl(java.lang.Object javaObj,
int id)
|
protected void |
init()
Initialize this object. |
boolean |
isA(Value type)
If this object is a type, determine if an instance of this type is an instance of the specified type, ie. |
protected void |
populateMemberSet(java.util.Set s,
boolean debugger)
Derived classes that implement getMember(int, boolean) should also
implement this. |
protected void |
populateTypeMemberSet(java.util.Set s,
boolean debugger)
Derived classes that implement getTypeMember(oscript.data.Value, int) should also
implement this. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.Class javaClass
protected transient JavaClassWrapper.JavaClassWrapperImpl impl
protected transient JavaClassWrapper.JavaClassWrapperImpl wrapperImpl
public static final Value TYPE
public static final java.lang.String PARENT_TYPE_NAME
public static final java.lang.String TYPE_NAME
public static final java.lang.String[] MEMBER_NAMES
Constructor Detail |
protected JavaClassWrapper(java.lang.Class javaClass)
javaClass
- the java class this object is a wrapper forMethod Detail |
public static JavaClassWrapper getClassWrapper(java.lang.Class javaClass)
javaClass
- the java class this object is a wrapper forpublic static JavaClassWrapper getClassWrapper(java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public static java.lang.Class forName(java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected void init()
impl
and wrapperImpl
are transient, and
might not exist if this object gets unserialized...
protected Value getTypeImpl()
Value.getType()
.
getTypeImpl
in class Value
public java.lang.String getName()
String
value.
PackagedScriptObjectException(NoSuchMethodException)
public boolean isA(Value type)
type
,
or a subclass.
isA
in class Type
type
- the type to compare this type to
true
or false
PackagedScriptObjectException(NoSuchMemberException)
public java.lang.String castToString() throws PackagedScriptObjectException
String
value.
castToString
in class Value
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException
public java.lang.Object castToJavaObject() throws PackagedScriptObjectException
Object
value.
castToJavaObject
in class Value
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException
public Value callAsConstructor(StackFrame sf, MemberTable args) throws PackagedScriptObjectException
callAsConstructor
in class Value
sf
- the current stack frameargs
- the arguments to the function, or null
if none
PackagedScriptObjectException
Function
public Value callAsExtends(StackFrame sf, Scope scope, MemberTable args) throws PackagedScriptObjectException
callAsExtends
in class Value
sf
- the current stack framescope
- the objectargs
- the arguments to the function, or null
if none
PackagedScriptObjectException
Function
protected java.lang.Object doConstruct(StackFrame sf, MemberTable args, boolean isWrapper)
public Value getMember(int id, boolean exception) throws PackagedScriptObjectException
getMember
in class Value
id
- the id of the symbol that maps to the memberexception
- whether an exception should be thrown if the
member object is not resolved
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException(NoSuchMemberException)
PackagedScriptObjectException
protected Value getTypeMember(Value obj, int id)
getTypeMember
in class Value
obj
- an object of this typeid
- the id of the symbol that maps to the member
Value.populateTypeMemberSet(java.util.Set, boolean)
protected Value getTypeMemberImpl(java.lang.Object javaObj, int id)
public java.lang.ClassLoader getClassLoader()
ClassLoader
object for the java class this class is
a wrapper for.
ClassLoader
of the java classprotected void populateMemberSet(java.util.Set s, boolean debugger)
getMember(int, boolean)
should also
implement this.
populateMemberSet
in class Value
s
- the set to populatedebugger
- true
if being used by debugger, in
which case both public and private/protected field names should
be returnedgetMember(int, boolean)
protected void populateTypeMemberSet(java.util.Set s, boolean debugger)
getTypeMember(oscript.data.Value, int)
should also
implement this.
populateTypeMemberSet
in class Value
s
- the set to populatedebugger
- true
if being used by debugger, in
which case both public and private/protected field names should
be returnedgetTypeMember(oscript.data.Value, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |