Package com.aparapi.internal.model
Class ClassModel
java.lang.Object
com.aparapi.internal.model.ClassModel
Class represents a ClassFile (MyClass.class).
A ClassModel is constructed from an instance of a
java.lang.Class
.
If the java class mode changes we may need to modify this to accommodate.- Author:
- gfrost
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
class
class
class
class
class
static enum
static interface
static interface
static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final char
static final char
static final char
static final char
static final char
static final char
static final char
static final char
static final char
static final char
static final char
static final char
static final char
static final char
static final char
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
static String
static ClassModel
createClassModel
(Class<?> _class) int
Class
<?> getEntrypoint
(String _entrypointName, Object _k) int
getMagic()
int
getMethod
(ClassModel.ConstantPool.MethodEntry _methodEntry, boolean _isSpecial) Look up a ConstantPool MethodEntry and return the corresponding Method.static ClassModel.MethodDescription
getMethodDescription
(String _string) getMethodModel
(String _name, String _signature) Create a MethodModel for a given method name and signature.int
getPrivateMemorySize
(String fieldName) If a field does not satisfy the private memory conditions, null, otherwise the size of private memory required.static Integer
static Integer
getPrivateMemorySizeFromFieldName
(String fieldName) int
Getter for superClazzint
int
static void
boolean
isSuperClass
(Class<?> other) Determine if this is the superclass of some other class.boolean
isSuperClass
(String otherClassName) Determine if this is the superclass of some other named class.void
void
setTotalStructSize
(int x) toString()
static String
typeName
(char _typeChar) Convert a given JNI character type (say 'I') to its type name ('int').
-
Field Details
-
SIGC_VOID
public static final char SIGC_VOID- See Also:
-
SIGC_BOOLEAN
public static final char SIGC_BOOLEAN- See Also:
-
SIGC_BYTE
public static final char SIGC_BYTE- See Also:
-
SIGC_CHAR
public static final char SIGC_CHAR- See Also:
-
SIGC_SHORT
public static final char SIGC_SHORT- See Also:
-
SIGC_INT
public static final char SIGC_INT- See Also:
-
SIGC_LONG
public static final char SIGC_LONG- See Also:
-
SIGC_FLOAT
public static final char SIGC_FLOAT- See Also:
-
SIGC_DOUBLE
public static final char SIGC_DOUBLE- See Also:
-
SIGC_ARRAY
public static final char SIGC_ARRAY- See Also:
-
SIGC_CLASS
public static final char SIGC_CLASS- See Also:
-
SIGC_START_METHOD
public static final char SIGC_START_METHOD- See Also:
-
SIGC_END_CLASS
public static final char SIGC_END_CLASS- See Also:
-
SIGC_END_METHOD
public static final char SIGC_END_METHOD- See Also:
-
SIGC_PACKAGE
public static final char SIGC_PACKAGE- See Also:
-
-
Method Details
-
isSuperClass
Determine if this is the superclass of some other named class.- Parameters:
otherClassName
- The name of the class to compare against- Returns:
- true if 'this' a superclass of another named class
-
isSuperClass
Determine if this is the superclass of some other class.- Parameters:
other
- The class to compare against- Returns:
- true if 'this' a superclass of another class
-
getSuperClazz
Getter for superClazz- Returns:
- the superClazz ClassModel
-
replaceSuperClazz
-
typeName
Convert a given JNI character type (say 'I') to its type name ('int').- Parameters:
_typeChar
-- Returns:
- either a mapped type name or null if no mapping exists.
-
getPrivateMemorySize
If a field does not satisfy the private memory conditions, null, otherwise the size of private memory required.- Throws:
ClassParseException
-
getPrivateMemorySizeFromField
-
getPrivateMemorySizeFromFieldName
public static Integer getPrivateMemorySizeFromFieldName(String fieldName) throws ClassParseException - Throws:
ClassParseException
-
getNoCLMethods
-
convert
-
convert
-
convert
-
getMethodDescription
-
createClassModel
- Throws:
ClassParseException
-
getMagic
public int getMagic() -
getMajorVersion
public int getMajorVersion() -
getMinorVersion
public int getMinorVersion() -
getAccessFlags
public int getAccessFlags() -
getConstantPool
-
getThisClassConstantPoolIndex
public int getThisClassConstantPoolIndex() -
getSuperClassConstantPoolIndex
public int getSuperClassConstantPoolIndex() -
getAttributePool
-
getField
-
getField
-
getMethod
-
getFieldPoolEntries
-
getMethod
public ClassModel.ClassModelMethod getMethod(ClassModel.ConstantPool.MethodEntry _methodEntry, boolean _isSpecial) Look up a ConstantPool MethodEntry and return the corresponding Method.- Parameters:
_methodEntry
- The ConstantPool MethodEntry we want._isSpecial
- True if we wish to delegate to super (to supportsuper.foo()
)- Returns:
- The Method or null if we fail to locate a given method.
-
getMethodModel
Create a MethodModel for a given method name and signature.- Parameters:
_name
-_signature
-- Returns:
- Throws:
AparapiException
-
getStructMembers
-
getStructMemberOffsets
-
getStructMemberTypes
-
getTotalStructSize
public int getTotalStructSize() -
setTotalStructSize
public void setTotalStructSize(int x) -
getClassWeAreModelling
-
getEntrypoint
- Throws:
AparapiException
-
getEntrypoint
- Throws:
AparapiException
-
invalidateCaches
public static void invalidateCaches() -
toString
-