Package serp.bytecode
Class ObjectState
- java.lang.Object
-
- serp.bytecode.State
-
- serp.bytecode.ObjectState
-
class ObjectState extends State
State implementing the behavior of an object type.
-
-
Field Summary
Fields Modifier and Type Field Description private int_accessprivate java.util.List_attributesprivate java.util.List_fieldsprivate int_indexprivate java.util.List_interfacesprivate int_magicprivate int_majorprivate java.util.List_methodsprivate int_minorprivate NameCache_namesprivate ConstantPool_poolprivate int_superclassIndex
-
Constructor Summary
Constructors Constructor Description ObjectState(NameCache names)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAccessFlags()Return the access flags of the bytecode class.java.util.CollectiongetAttributesHolder()Return theAttributes of this class, or empty list if none.java.lang.StringgetComponentName()Return the name of the component type of this array, or null if not an array.java.util.ListgetFieldsHolder()Return theBCFields of this class, or empty list if none.intgetIndex()Return theConstantPoolindex of theClassEntryfor this class, or 0 if none.java.util.ListgetInterfacesHolder()Return theConstantPoolindexes of theClassEntrys for the indexes of this class, or empty list if none.intgetMagic()Return the magic number of the bytecode class.intgetMajorVersion()Return the major number of the bytecode class.java.util.ListgetMethodsHolder()Return theBCMethods of this class, or empty list if none.intgetMinorVersion()Return the minor number of the bytecode class.java.lang.StringgetName()Return the name of the class.ConstantPoolgetPool()Return the constant pool of the class.intgetSuperclassIndex()Return theConstantPoolindex of theClassEntryfor the superclass of this class, or 0 if none.java.lang.StringgetSuperclassName()Return the name of the superclass.booleanisArray()Return true if this class is an array.booleanisPrimitive()Return 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 Detail
-
_pool
private final ConstantPool _pool
-
_names
private final NameCache _names
-
_index
private int _index
-
_superclassIndex
private int _superclassIndex
-
_magic
private int _magic
-
_major
private int _major
-
_minor
private int _minor
-
_access
private int _access
-
_interfaces
private final java.util.List _interfaces
-
_fields
private final java.util.List _fields
-
_methods
private final java.util.List _methods
-
_attributes
private final java.util.List _attributes
-
-
Constructor Detail
-
ObjectState
public ObjectState(NameCache names)
-
-
Method Detail
-
getMagic
public int getMagic()
Description copied from class:StateReturn the magic number of the bytecode class.
-
setMagic
public void setMagic(int magic)
Description copied from class:StateSet the magic number of the bytecode class.
-
getMajorVersion
public int getMajorVersion()
Description copied from class:StateReturn the major number of the bytecode class.- Overrides:
getMajorVersionin classState
-
setMajorVersion
public void setMajorVersion(int major)
Description copied from class:StateSet the major version of the bytecode class.- Overrides:
setMajorVersionin classState
-
getMinorVersion
public int getMinorVersion()
Description copied from class:StateReturn the minor number of the bytecode class.- Overrides:
getMinorVersionin classState
-
setMinorVersion
public void setMinorVersion(int minor)
Description copied from class:StateSet the minor version of the bytecode class.- Overrides:
setMinorVersionin classState
-
getAccessFlags
public int getAccessFlags()
Description copied from class:StateReturn the access flags of the bytecode class.- Overrides:
getAccessFlagsin classState
-
setAccessFlags
public void setAccessFlags(int access)
Description copied from class:StateSet the access flags of the bytecode class.- Overrides:
setAccessFlagsin classState
-
getIndex
public int getIndex()
Description copied from class:StateReturn theConstantPoolindex of theClassEntryfor this class, or 0 if none.
-
setIndex
public void setIndex(int index)
Description copied from class:StateSet theConstantPoolindex of theClassEntryfor this class.
-
getSuperclassIndex
public int getSuperclassIndex()
Description copied from class:StateReturn theConstantPoolindex of theClassEntryfor the superclass of this class, or 0 if none.- Overrides:
getSuperclassIndexin classState
-
setSuperclassIndex
public void setSuperclassIndex(int index)
Description copied from class:StateSet theConstantPoolindex of theClassEntryfor the superclass of this class. ThrowsUnsupportedOperationExceptionby default.- Overrides:
setSuperclassIndexin classState
-
getInterfacesHolder
public java.util.List getInterfacesHolder()
Description copied from class:StateReturn 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.- Overrides:
getInterfacesHolderin classState
-
getFieldsHolder
public java.util.List getFieldsHolder()
Description copied from class:StateReturn theBCFields of this class, or empty list if none. If the state does not support changing the fields, the returned list should be immutable.- Overrides:
getFieldsHolderin classState
-
getMethodsHolder
public java.util.List getMethodsHolder()
Description copied from class:StateReturn theBCMethods of this class, or empty list if none. If the state does not support changing the methods, the returned list should be immutable.- Overrides:
getMethodsHolderin classState
-
getAttributesHolder
public java.util.Collection getAttributesHolder()
Description copied from class:StateReturn theAttributes of this class, or empty list if none. If the state does not support changing the attributes, the returned list should be immutable.- Overrides:
getAttributesHolderin classState
-
getPool
public ConstantPool getPool()
Description copied from class:StateReturn the constant pool of the class.
-
getName
public java.lang.String getName()
Description copied from class:StateReturn the name of the class. The name should be in a form suitable for aClass.forName(java.lang.String)call.
-
getSuperclassName
public java.lang.String getSuperclassName()
Description copied from class:StateReturn the name of the superclass. The name should be in a form suitable for aClass.forName(java.lang.String)call, or null if none.- Overrides:
getSuperclassNamein classState
-
getComponentName
public java.lang.String getComponentName()
Description copied from class:StateReturn 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.- Overrides:
getComponentNamein classState
-
isPrimitive
public boolean isPrimitive()
Description copied from class:StateReturn true if this class is a primitive.- Overrides:
isPrimitivein classState
-
-