Package com.aparapi.internal.model
Class ClassModel
java.lang.Object
com.aparapi.internal.model.ClassModel
public class ClassModel extends Object
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:
- Java 5 Class File Format + * @see Java 7 Class File Format
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClassModel.Access
class
ClassModel.AttributePool
class
ClassModel.ClassModelField
class
ClassModel.ClassModelInterface
class
ClassModel.ClassModelMethod
class
ClassModel.ConstantPool
static class
ClassModel.ConstantPoolType
static interface
ClassModel.LocalVariableInfo
static interface
ClassModel.LocalVariableTableEntry<T extends ClassModel.LocalVariableInfo>
static class
ClassModel.MethodDescription
-
Field Summary
Fields Modifier and Type Field Description static char
SIGC_ARRAY
static char
SIGC_BOOLEAN
static char
SIGC_BYTE
static char
SIGC_CHAR
static char
SIGC_CLASS
static char
SIGC_DOUBLE
static char
SIGC_END_CLASS
static char
SIGC_END_METHOD
static char
SIGC_FLOAT
static char
SIGC_INT
static char
SIGC_LONG
static char
SIGC_PACKAGE
static char
SIGC_SHORT
static char
SIGC_START_METHOD
static char
SIGC_VOID
-
Method Summary
-
Field Details
-
SIGC_VOID
public static final char SIGC_VOID- See Also:
- Constant Field Values
-
SIGC_BOOLEAN
public static final char SIGC_BOOLEAN- See Also:
- Constant Field Values
-
SIGC_BYTE
public static final char SIGC_BYTE- See Also:
- Constant Field Values
-
SIGC_CHAR
public static final char SIGC_CHAR- See Also:
- Constant Field Values
-
SIGC_SHORT
public static final char SIGC_SHORT- See Also:
- Constant Field Values
-
SIGC_INT
public static final char SIGC_INT- See Also:
- Constant Field Values
-
SIGC_LONG
public static final char SIGC_LONG- See Also:
- Constant Field Values
-
SIGC_FLOAT
public static final char SIGC_FLOAT- See Also:
- Constant Field Values
-
SIGC_DOUBLE
public static final char SIGC_DOUBLE- See Also:
- Constant Field Values
-
SIGC_ARRAY
public static final char SIGC_ARRAY- See Also:
- Constant Field Values
-
SIGC_CLASS
public static final char SIGC_CLASS- See Also:
- Constant Field Values
-
SIGC_START_METHOD
public static final char SIGC_START_METHOD- See Also:
- Constant Field Values
-
SIGC_END_CLASS
public static final char SIGC_END_CLASS- See Also:
- Constant Field Values
-
SIGC_END_METHOD
public static final char SIGC_END_METHOD- See Also:
- Constant Field Values
-
SIGC_PACKAGE
public static final char SIGC_PACKAGE- See Also:
- Constant Field Values
-
-
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
-