java.lang.Object
de.grogra.reflect.XObjectImpl
de.grogra.reflect.XClass<T>
- Direct Known Subclasses:
CClass
-
Field Summary
Fields inherited from interface de.grogra.reflect.Member
ABSTRACT, ACCESS_MODIFIERS, ARRAY, BRIDGE, CONSTANT, FINAL, INTERFACE, JAVA_MODIFIERS, LOCAL_CLASS, MIN_UNUSED_MODIFIER, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE
Fields inherited from interface de.grogra.reflect.Type
BOOLEAN, BYTE, CHAR, CLASS, DOUBLE, FLOAT, FLOATING_POINT, INT, INTEGRAL, INVALID, LOCAL_CLASS_MODIFIERS, LONG, MEMBER_CLASS_MODIFIERS, MEMBER_INTERFACE_MODIFIERS, NULL, NUMBER, NUMERIC, OBJECT, SHORT, STRING, TEXTAREA, TOP_LEVEL_CLASS_MODIFIERS, TOP_LEVEL_INTERFACE_MODIFIERS, TYPE, TYPE_0, VOID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addInterface
(Type<?> type) cloneObject
(T o, boolean deep) createArray
(int length) declareAuxField
(String name, int modifiers, Type<?> type) declareField
(String name, int modifiers, Type<?> type) void
declareMethod
(Method method) declareSyntheticField
(String baseName, int modifiers, Type<?> type) void
declareType
(XClass<?> type) Type<?>
Type<?>
getDeclaredAnnotation
(int index) int
getDeclaredField
(int index) getDeclaredField
(String name) int
Type<?>
getDeclaredInterface
(int index) int
getDeclaredMethod
(int index) int
Type<?>
getDeclaredType
(int index) int
Type<?>
Returns the declaring type of which this is a member.getDefaultElementValue
(String name) Returns a descriptor for this member.final Lookup
int
Returns the modifiers of this member as a combination of the bit masks which are defined in this interface.getName()
Returns the name of this member.Returns the simple name of this member.int
Returns the type id of this type.boolean
void
void
initSupertype
(Type<? super T> superclass) void
initTypeLoader
(TypeLoader loader) boolean
isInstance
(Object object) boolean
void
makeVisible
(XField field) void
removeField
(Field field) void
removeMethod
(Method method) void
toString()
protected final void
Methods inherited from class de.grogra.reflect.XObjectImpl
getXClass, getXData, initXClass
-
Constructor Details
-
XClass
-
-
Method Details
-
initSupertype
-
initTypeLoader
-
initialize
public void initialize() -
declareSyntheticField
-
declareAuxField
-
declareField
-
removeField
-
makeVisible
-
declareMethod
-
removeMethod
-
declareType
-
addInterface
-
getDeclaredAnnotations
-
newInstance
public T newInstance() throws InvocationTargetException, InstantiationException, IllegalAccessException- Specified by:
newInstance
in interfaceType<T>
- Throws:
InvocationTargetException
InstantiationException
IllegalAccessException
-
getTypeId
public int getTypeId()Description copied from interface:Type
Returns the type id of this type. -
getPackage
- Specified by:
getPackage
in interfaceType<T>
-
getModifiers
public int getModifiers()Description copied from interface:Member
Returns the modifiers of this member as a combination of the bit masks which are defined in this interface.- Specified by:
getModifiers
in interfaceMember
- Returns:
- modifiers of this member
-
setPublic
public void setPublic() -
getDeclaringType
Description copied from interface:Member
Returns the declaring type of which this is a member. May benull
if such a type does not exist.- Specified by:
getDeclaringType
in interfaceMember
- Returns:
- this member's declaring type
-
hasSupertypeBeenSet
public boolean hasSupertypeBeenSet() -
getSupertype
- Specified by:
getSupertype
in interfaceType<T>
-
getName
Description copied from interface:Member
Returns the name of this member. For types, this is the canonical name of the type, e.g,java.lang.Object
,java.util.Map.Entry
. Otherwise, it equalsMember.getSimpleName()
. -
getBinaryName
- Specified by:
getBinaryName
in interfaceType<T>
-
getDescriptor
Description copied from interface:Member
Returns a descriptor for this member. Descriptors are constructed as follows:- For types, descriptors are defined as for the Java Virtual
Machine. For primitive types these are the single characters
'Z', 'B', 'S', 'C', 'I', 'J', 'F', 'D', 'V'
for
boolean
,byte
,short
,char
,int
,long
,float
,double
,void
. For array types, the descriptor is the character '[' plus the descriptor of its component type, e.g.,[[I
forint[][]
. For non-array reference types, the descriptor is the character 'L', followed by the binary name (seeType.getBinaryName()
) of the type, where '.' has to be replaced by '/', followed by ';', e.g.,Ljava/lang/Object;
. - For fields, the descriptor is the character 'f', followed by the
simple name of the field, followed by the character ';', followed
by the descriptor of the field's type. E.g.,
fout;Ljava/io/PrintStream;
for the fieldSystem.out
. - For methods and constructors, the descriptor is the character
'm', followed by the simple name of the method (which is
<init>
for constructors), followed by the characters ';' and '(', followed by the descriptors of the method's parameter types, followed by ')', followed by the descriptor of the return type. E.g.mprintln;(Ljava/lang/String;)V
for the methodPrintStream.println(String)
.
- Specified by:
getDescriptor
in interfaceMember
- Returns:
- the member's descriptor
- For types, descriptors are defined as for the Java Virtual
Machine. For primitive types these are the single characters
'Z', 'B', 'S', 'C', 'I', 'J', 'F', 'D', 'V'
for
-
isInstance
- Specified by:
isInstance
in interfaceType<T>
-
getImplementationClass
- Specified by:
getImplementationClass
in interfaceType<T>
-
getTypeLoader
- Specified by:
getTypeLoader
in interfaceType<T>
-
getDeclaredInterfaceCount
public int getDeclaredInterfaceCount()- Specified by:
getDeclaredInterfaceCount
in interfaceType<T>
-
getDeclaredInterface
- Specified by:
getDeclaredInterface
in interfaceType<T>
-
getDeclaredTypeCount
public int getDeclaredTypeCount()- Specified by:
getDeclaredTypeCount
in interfaceType<T>
-
getDeclaredType
- Specified by:
getDeclaredType
in interfaceType<T>
-
getDeclaredFieldCount
public int getDeclaredFieldCount()- Specified by:
getDeclaredFieldCount
in interfaceType<T>
-
getDeclaredField
- Specified by:
getDeclaredField
in interfaceType<T>
-
getDeclaredField
-
getDeclaredMethodCount
public int getDeclaredMethodCount()- Specified by:
getDeclaredMethodCount
in interfaceType<T>
-
getDeclaredMethod
- Specified by:
getDeclaredMethod
in interfaceType<T>
-
getDeclaredAnnotationCount
public int getDeclaredAnnotationCount()- Specified by:
getDeclaredAnnotationCount
in interfaceMember
-
getDeclaredAnnotation
- Specified by:
getDeclaredAnnotation
in interfaceMember
-
getSimpleName
Description copied from interface:Member
Returns the simple name of this member. This is the single identifier with which the member is declared in source code, e.g.,Object
,out
,println
.- Specified by:
getSimpleName
in interfaceMember
- Returns:
- simple name of the member
-
getComponentType
- Specified by:
getComponentType
in interfaceType<T>
-
getArrayType
- Specified by:
getArrayType
in interfaceType<T>
-
createArray
- Specified by:
createArray
in interfaceType<T>
-
toString
-
isStringSerializable
public boolean isStringSerializable()- Specified by:
isStringSerializable
in interfaceType<T>
-
valueOf
-
cloneObject
- Specified by:
cloneObject
in interfaceType<T>
-
getLookup
-
updateLookup
protected final void updateLookup() -
getDefaultElementValue
- Specified by:
getDefaultElementValue
in interfaceType<T>
-