|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.openfoundation.util.XPType
Instances of the class XPType
represent classes and interfaces
in a running Plumtree application. Every array also belongs to a class that is
reflected as a XPType
object that is shared by all arrays with
the same element type and number of dimensions. The primitive types
(boolean
, byte
, char
,
short
, int
, long
,
float
, and double
), and the keyword
void
are also represented as Class
objects.
XPType
has no public constructor. Instead XPType
objects are constructed automatically by the Java Virtual Machine as classes
are loaded and by calls to the defineClass
method in the class
loader.
Field Summary | |
static XPType |
BOOLEAN
The XPType object representing the primitive type boolean. |
static XPType |
BYTE
The XPType object representing the primitive type byte. |
static XPType |
CHAR
The XPType object representing the primitive type char. |
static XPType |
DOUBLE
The XPType object representing the primitive type double. |
static XPType |
FLOAT
The XPType object representing the primitive type float. |
static XPType |
INTEGER
The XPType object representing the primitive type int. |
static XPType |
LONG
The XPType object representing the primitive type long. |
static XPType |
SHORT
The XPType object representing the primitive type short. |
static XPType |
VOID
The XPType object representing the primitive type void. |
Constructor Summary | |
XPType(java.lang.Class _class)
XPType Constructor and it takes Class Object. |
Method Summary | |
java.lang.Object |
CreateInstance()
Creates a new instance of the class represented by this XPType object. |
boolean |
equals(java.lang.Object obj)
Compares an object with this XPType. |
boolean |
Equals(java.lang.Object obj)
Compares an object with this XPType. |
XPType |
GetBaseType()
Returns the XPType representing the superclass of the entity
(class, interface, primitive type or void) represented by this
XPType . |
XPConstructor |
GetConstructor(XPType[] constructorArgs)
Returns a XPConstructor object that reflects the specified
public constructor of the class represented by this XPType
object. |
XPField[] |
GetDeclaredFields()
Gets all fields declared on this class (not superclasses). |
XPMethod |
GetDeclaredMethod(java.lang.String name,
XPType[] methodArgs)
Returns a XPMethod object that reflects the specified
declared method of the class or interface represented by this
XPType object. |
XPMethod[] |
GetDeclaredMethods()
Returns an array of XPMethod objects reflecting all the
methods declared by the class or interface represented by this
XPType object. |
XPMethod |
GetMethod(java.lang.String name,
XPType[] methodArgs)
Return a reflective handle to a method by name. |
XPMethod[] |
GetMethods()
Returns all methods available on this type. |
java.lang.String |
GetName()
Returns the name of the entity (class, interface, array class, primitive type, or void) represented by this XPType object, as a String. |
static java.lang.String |
GetName(java.lang.Class jclass)
Returns the name of the entity (class, interface, array class, primitive type, or void) represented by this XPType object, as a String. |
XPField[] |
GetPublicFields()
Gets all public fields available on this class (and superclasses). |
XPInputStream |
GetResourceAsStream(java.lang.String name)
Finds a resource with a given name. |
static XPType |
GetType(java.lang.String fullName)
Returns the XPType object associated with the class or
interface with the given string name. |
java.lang.Class |
GetUnderlyingObject()
Gets the underlying Class of XPType. |
int |
hashCode()
Returns the hash code value for this type. |
boolean |
IsAssignableFrom(XPType type)
Determines if the class or interface represented by this XPType object is either the same as, or is a superclass or
superinterface of, the class or interface represented by the specified
XPType parameter. |
boolean |
IsPublic()
Return true if the integer argument includes the public modifer, false otherwise. |
boolean |
IsVoidType()
Indicates whether some other object is "equal to" this one. |
java.lang.String |
toString()
Returns a string which may be useful in representing this object at runtime. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final XPType BOOLEAN
public static final XPType INTEGER
public static final XPType SHORT
public static final XPType LONG
public static final XPType FLOAT
public static final XPType DOUBLE
public static final XPType CHAR
public static final XPType BYTE
public static final XPType VOID
Constructor Detail |
public XPType(java.lang.Class _class)
_class
- This class Object.Method Detail |
public static XPType GetType(java.lang.String fullName)
XPType
object associated with the class or
interface with the given string name.
fullName
- the fully qualified name of the desired class.
XPType
object for the class with the
specified name.
java.lang.LinkageError
- if the linkage fails
java.lang.ExceptionInInitializerError
- if the initialization provoked
by this method fails
java.lang.ClassNotFoundException
- if the class cannot be locatedpublic java.lang.Object CreateInstance()
new
expression with an empty argument list. The class is initialized if it
has not already been initialized.
If there is a security manager, this method first calls the security
manager's checkMemberAccess
method with this
and Member.PUBLIC
as its arguments. If the class is in a
package, then this method also calls the security manager's
checkPackageAccess
method with the package name as its
argument. Either of these calls could result in a SecurityException.
java.lang.IllegalAccessException
- if the class or its nullary
constructor is not accessible.
java.lang.InstantiationException
- if this XPType
represents an abstract class,
an interface, an array class, a primitive type, or void;
or if the class has no nullary constructor;
or if the instantiation fails for some other reason.
java.lang.ExceptionInInitializerError
- if the initialization
provoked by this method fails.
java.lang.SecurityException
- if there is no permission to create a new
instance.public static java.lang.String GetName(java.lang.Class jclass)
If this class object represents a reference type that is not an array type then the binary name of the class is returned, as specified by the Java Language Specification, Second Edition.
If this class object represents a primitive type or void, then the name returned is a String equal to the Java language keyword corresponding to the primitive type or void.
If this class object represents a class of arrays, then the internal form of the name consists of the name of the element type preceded by one or more '[' characters representing the depth of the array nesting. The encoding of element type names is as follows:
Element XPType Encoding boolean Z byte B char C class or interface Lclassname; double D float F int I long J short S
The class or interface name classname is the binary name of the class specified above.
jclass
- classname
public java.lang.String GetName()
If this class object represents a reference type that is not an array type then the binary name of the class is returned, as specified by the Java Language Specification, Second Edition.
If this class object represents a primitive type or void, then the name returned is a String equal to the Java language keyword corresponding to the primitive type or void.
If this class object represents a class of arrays, then the internal form of the name consists of the name of the element type preceded by one or more '[' characters representing the depth of the array nesting. The encoding of element type names is as follows:
Element XPType Encoding boolean Z byte B char C class or interface Lclassname; double D float F int I long J short S
The class or interface name classname is the binary name of the class specified above.
public XPConstructor GetConstructor(XPType[] constructorArgs)
XPConstructor
object that reflects the specified
public constructor of the class represented by this XPType
object.
constructorArgs
- an array of XPType objects
XPConstructor
object of the public constructor that
matches the specified parameterTypes
java.lang.NoSuchMethodException
- if a matching method is not found.
java.lang.SecurityException
- if access to the information is denied.public boolean IsPublic()
mod
includes the
public modifier; false otherwise.public XPType GetBaseType()
XPType
representing the superclass of the entity
(class, interface, primitive type or void) represented by this
XPType
. If this XPType
represents either the
Object
class, an interface, a primitive type, or void, then
null is returned. If this object represents an array class then the
XPType
object representing the Object
class is
returned.
public boolean IsAssignableFrom(XPType type)
XPType
object is either the same as, or is a superclass or
superinterface of, the class or interface represented by the specified
XPType
parameter. It returns true
if so;
otherwise it returns false
. If this XPType
object represents a primitive type, this method returns
true
if the specified XPType
parameter is
exactly this XPType
object; otherwise it returns
false
.
type
- the XPType
object to be checked
boolean
value indicating whether objects of the
type type
can be assigned to objects of this classpublic XPMethod[] GetMethods()
public XPMethod GetMethod(java.lang.String name, XPType[] methodArgs)
name
- Name of the method to return a reflective handle to.methodArgs
- array of XPType objects representing argument types; use XPType.INTEGER etc. for Java primitives.
XPNoSuchMethodException
- if not found.public XPMethod[] GetDeclaredMethods()
XPMethod
objects reflecting all the
methods declared by the class or interface represented by this
XPType
object. This includes public, protected, default
(package) access, and private methods, but excludes inherited methods.
The elements in the array returned are not sorted and are not in any
particular order. This method returns an array of length 0 if the class
or interface declares no methods, or if this XPType
object
represents a primitive type, an array class, or void. The class
initialization method <clinit>
is not included in the
returned array. If the class declares multiple public member methods
with the same parameter types, they are all included in the returned
array.
XPMethod
objects representing all the
declared methods of this class
java.lang.SecurityException
- if access to the information is denied.public XPMethod GetDeclaredMethod(java.lang.String name, XPType[] methodArgs)
XPMethod
object that reflects the specified
declared method of the class or interface represented by this
XPType
object. The name
parameter is a
String
that specifies the simple name of the desired
method, and the parameterTypes
parameter is an array of
XPMethod
objects that identify the method's formal parameter
types, in declared order. If more than one method with the same
parameter types is declared in a class, and one of these methods has a
return type that is more specific than any of the others, that method is
returned; otherwise one of the methods is chosen arbitrarily. If the
name is "<init>"or "<clinit>" a NoSuchMethodException
is raised.
name
- the name of the methodmethodArgs
- the parameter array
Method
object for the method of this class
matching the specified name and parameters
java.lang.NoSuchMethodException
- if a matching method is not found.
java.lang.NullPointerException
- if name
is null
java.lang.SecurityException
- if access to the information is denied.public XPField[] GetPublicFields()
public XPField[] GetDeclaredFields()
public XPInputStream GetResourceAsStream(java.lang.String name)
name
- name of the desired resource
XPInputStream
object or null
.public boolean IsVoidType()
true
if this object is the same as the obj
argument; false
otherwise.public java.lang.Class GetUnderlyingObject()
public boolean Equals(java.lang.Object obj)
obj
- to test equals with
public boolean equals(java.lang.Object obj)
obj
- to test equals with
public int hashCode()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |