Package serp.bytecode
Class State
java.lang.Object
serp.bytecode.State
- Direct Known Subclasses:
ArrayState,ObjectState,PrimitiveState
The State type is extended by various concrete types to change
the behavior of a
BCClass. All methods in this base
implementation throw an UnsupportedOperationException-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturn the access flags of the bytecode class.Return theAttributes of this class, or empty list if none.Return the name of the component type of this array, or null if not an array.Return theBCFields of this class, or empty list if none.intgetIndex()Return theConstantPoolindex of theClassEntryfor this class, or 0 if none.Return theConstantPoolindexes of theClassEntrys for the indexes of this class, or empty list if none.intgetMagic()Return the magic number of the bytecode class.intReturn the major number of the bytecode class.Return theBCMethods of this class, or empty list if none.intReturn the minor number of the bytecode class.getName()Return the name of the class.getPool()Return the constant pool of the class.intReturn theConstantPoolindex of theClassEntryfor the superclass of this class, or 0 if none.Return the name of the superclass.booleanisArray()Return true if this class is an array.booleanReturn true if this class is a primitive.voidsetAccessFlags(int access) Set the access flags of the bytecode class.voidsetIndex(int index) Set theConstantPoolindex of theClassEntryfor this class.voidsetMagic(int magic) Set the magic number of the bytecode class.voidsetMajorVersion(int major) Set the major version of the bytecode class.voidsetMinorVersion(int minor) Set the minor version of the bytecode class.voidsetSuperclassIndex(int index) Set theConstantPoolindex of theClassEntryfor the superclass of this class.
-
Field Details
-
INVALID
A singleton instance of this type that can be used to make a class invalid.
-
-
Constructor Details
-
State
State()
-
-
Method Details
-
getMagic
public int getMagic()Return the magic number of the bytecode class. -
setMagic
public void setMagic(int magic) Set the magic number of the bytecode class. -
getMajorVersion
public int getMajorVersion()Return the major number of the bytecode class. -
setMajorVersion
public void setMajorVersion(int major) Set the major version of the bytecode class. -
getMinorVersion
public int getMinorVersion()Return the minor number of the bytecode class. -
setMinorVersion
public void setMinorVersion(int minor) Set the minor version of the bytecode class. -
getAccessFlags
public int getAccessFlags()Return the access flags of the bytecode class. -
setAccessFlags
public void setAccessFlags(int access) Set the access flags of the bytecode class. -
getIndex
public int getIndex()Return theConstantPoolindex of theClassEntryfor this class, or 0 if none. -
setIndex
public void setIndex(int index) Set theConstantPoolindex of theClassEntryfor this class. -
getSuperclassIndex
public int getSuperclassIndex()Return theConstantPoolindex of theClassEntryfor the superclass of this class, or 0 if none. -
setSuperclassIndex
public void setSuperclassIndex(int index) Set theConstantPoolindex of theClassEntryfor the superclass of this class. ThrowsUnsupportedOperationExceptionby default. -
getInterfacesHolder
Return theConstantPoolindexes of theClassEntrys for the indexes of this class, or empty list if none. If the state does not support changing the interfaces, the returned list should be immutable. -
getFieldsHolder
Return theBCFields of this class, or empty list if none. If the state does not support changing the fields, the returned list should be immutable. -
getMethodsHolder
Return theBCMethods of this class, or empty list if none. If the state does not support changing the methods, the returned list should be immutable. -
getAttributesHolder
Return theAttributes of this class, or empty list if none. If the state does not support changing the attributes, the returned list should be immutable. -
getPool
Return the constant pool of the class. -
getName
Return the name of the class. The name should be in a form suitable for aClass.forName(java.lang.String)call. -
getSuperclassName
Return the name of the superclass. The name should be in a form suitable for aClass.forName(java.lang.String)call, or null if none. -
getComponentName
Return the name of the component type of this array, or null if not an array. The name should be in a form suitable for aClass.forName(java.lang.String)call. -
isPrimitive
public boolean isPrimitive()Return true if this class is a primitive. -
isArray
public boolean isArray()Return true if this class is an array.
-