de.grogra.reflect
public class XClass<T> extends XObjectImpl implements Type<T>
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, VOIDABSTRACT, 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| Constructor and Description |
|---|
XClass(java.lang.String simpleName,
java.lang.String binaryName,
int modifiers,
Type<?> declaringClass,
boolean writable) |
| Modifier and Type | Method and Description |
|---|---|
void |
addInterface(Type<?> type) |
T |
cloneObject(T o,
boolean deep) |
java.lang.Object |
createArray(int length) |
XField |
declareAuxField(java.lang.String name,
int modifiers,
Type<?> type) |
XField |
declareField(java.lang.String name,
int modifiers,
Type<?> type) |
void |
declareMethod(Method method) |
XField |
declareSyntheticField(java.lang.String baseName,
int modifiers,
Type<?> type) |
void |
declareType(XClass<?> type) |
Type<?> |
getArrayType() |
java.lang.String |
getBinaryName() |
Type<?> |
getComponentType() |
Annotation |
getDeclaredAnnotation(int index) |
int |
getDeclaredAnnotationCount() |
java.util.List<Annotation> |
getDeclaredAnnotations() |
Field |
getDeclaredField(int index) |
XField |
getDeclaredField(java.lang.String name) |
int |
getDeclaredFieldCount() |
Type<?> |
getDeclaredInterface(int index) |
int |
getDeclaredInterfaceCount() |
Method |
getDeclaredMethod(int index) |
int |
getDeclaredMethodCount() |
Type<?> |
getDeclaredType(int index) |
int |
getDeclaredTypeCount() |
Type<?> |
getDeclaringType()
Returns the declaring type of which this is a member.
|
java.lang.Object |
getDefaultElementValue(java.lang.String name) |
java.lang.String |
getDescriptor()
Returns a descriptor for this member.
|
java.lang.Class<T> |
getImplementationClass() |
Lookup |
getLookup() |
int |
getModifiers()
Returns the modifiers of this member as a combination of
the bit masks which are defined in this interface.
|
java.lang.String |
getName()
Returns the name of this member.
|
java.lang.String |
getPackage() |
java.lang.String |
getSimpleName()
Returns the simple name of this member.
|
Type<? super T> |
getSupertype() |
int |
getTypeId()
Returns the type id of this type.
|
TypeLoader |
getTypeLoader() |
boolean |
hasSupertypeBeenSet() |
void |
initialize() |
void |
initSupertype(Type<? super T> superclass) |
void |
initTypeLoader(TypeLoader loader) |
boolean |
isInstance(java.lang.Object object) |
boolean |
isStringSerializable() |
void |
makeVisible(XField field) |
T |
newInstance() |
void |
removeField(Field field) |
void |
removeMethod(Method method) |
void |
setPublic() |
java.lang.String |
toString() |
protected void |
updateLookup() |
T |
valueOf(java.lang.String s) |
getXClass, getXData, initXClasspublic XClass(java.lang.String simpleName,
java.lang.String binaryName,
int modifiers,
Type<?> declaringClass,
boolean writable)
public void addInterface(Type<?> type)
public T cloneObject(T o, boolean deep)
cloneObject in interface Type<T>public java.lang.Object createArray(int length)
createArray in interface Type<T>public void declareMethod(Method method)
public XField declareSyntheticField(java.lang.String baseName, int modifiers, Type<?> type)
public void declareType(XClass<?> type)
public Type<?> getArrayType()
getArrayType in interface Type<T>public java.lang.String getBinaryName()
getBinaryName in interface Type<T>public Type<?> getComponentType()
getComponentType in interface Type<T>public Annotation getDeclaredAnnotation(int index)
getDeclaredAnnotation in interface Memberpublic int getDeclaredAnnotationCount()
getDeclaredAnnotationCount in interface Memberpublic java.util.List<Annotation> getDeclaredAnnotations()
public Field getDeclaredField(int index)
getDeclaredField in interface Type<T>public XField getDeclaredField(java.lang.String name)
public int getDeclaredFieldCount()
getDeclaredFieldCount in interface Type<T>public Type<?> getDeclaredInterface(int index)
getDeclaredInterface in interface Type<T>public int getDeclaredInterfaceCount()
getDeclaredInterfaceCount in interface Type<T>public Method getDeclaredMethod(int index)
getDeclaredMethod in interface Type<T>public int getDeclaredMethodCount()
getDeclaredMethodCount in interface Type<T>public Type<?> getDeclaredType(int index)
getDeclaredType in interface Type<T>public int getDeclaredTypeCount()
getDeclaredTypeCount in interface Type<T>public Type<?> getDeclaringType()
Membernull if such a type does not exist.getDeclaringType in interface Memberpublic java.lang.Object getDefaultElementValue(java.lang.String name)
getDefaultElementValue in interface Type<T>public java.lang.String getDescriptor()
Memberboolean, 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 for int[][]. For non-array
reference types, the
descriptor is the character 'L', followed by the binary name
(see Type.getBinaryName()) of the type, where '.'
has to be replaced by '/', followed by ';',
e.g., Ljava/lang/Object;.
fout;Ljava/io/PrintStream;
for the field System.out.
<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 method
PrintStream.println(String).
getDescriptor in interface Memberpublic java.lang.Class<T> getImplementationClass()
getImplementationClass in interface Type<T>public int getModifiers()
MembergetModifiers in interface Memberpublic java.lang.String getName()
Memberjava.lang.Object,
java.util.Map.Entry.
Otherwise, it equals Member.getSimpleName().public java.lang.String getPackage()
getPackage in interface Type<T>public java.lang.String getSimpleName()
MemberObject, out, println.getSimpleName in interface Memberpublic Type<? super T> getSupertype()
getSupertype in interface Type<T>public int getTypeId()
Typepublic TypeLoader getTypeLoader()
getTypeLoader in interface Type<T>public boolean hasSupertypeBeenSet()
public void initialize()
public void initTypeLoader(TypeLoader loader)
public boolean isInstance(java.lang.Object object)
isInstance in interface Type<T>public boolean isStringSerializable()
isStringSerializable in interface Type<T>public void makeVisible(XField field)
public T newInstance() throws java.lang.reflect.InvocationTargetException, java.lang.InstantiationException, java.lang.IllegalAccessException
newInstance in interface Type<T>java.lang.reflect.InvocationTargetExceptionjava.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionpublic void removeField(Field field)
public void removeMethod(Method method)
public void setPublic()
public java.lang.String toString()
toString in class java.lang.Objectprotected final void updateLookup()