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
_access
private java.util.List
_attributes
private java.util.List
_fields
private int
_index
private java.util.List
_interfaces
private int
_magic
private int
_major
private java.util.List
_methods
private int
_minor
private NameCache
_names
private ConstantPool
_pool
private int
_superclassIndex
-
Constructor Summary
Constructors Constructor Description ObjectState(NameCache names)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAccessFlags()
Return the access flags of the bytecode class.java.util.Collection
getAttributesHolder()
Return theAttribute
s of this class, or empty list if none.java.lang.String
getComponentName()
Return the name of the component type of this array, or null if not an array.java.util.List
getFieldsHolder()
Return theBCField
s of this class, or empty list if none.int
getIndex()
Return theConstantPool
index of theClassEntry
for this class, or 0 if none.java.util.List
getInterfacesHolder()
Return theConstantPool
indexes of theClassEntry
s for the indexes of this class, or empty list if none.int
getMagic()
Return the magic number of the bytecode class.int
getMajorVersion()
Return the major number of the bytecode class.java.util.List
getMethodsHolder()
Return theBCMethod
s of this class, or empty list if none.int
getMinorVersion()
Return the minor number of the bytecode class.java.lang.String
getName()
Return the name of the class.ConstantPool
getPool()
Return the constant pool of the class.int
getSuperclassIndex()
Return theConstantPool
index of theClassEntry
for the superclass of this class, or 0 if none.java.lang.String
getSuperclassName()
Return the name of the superclass.boolean
isArray()
Return true if this class is an array.boolean
isPrimitive()
Return true if this class is a primitive.void
setAccessFlags(int access)
Set the access flags of the bytecode class.void
setIndex(int index)
Set theConstantPool
index of theClassEntry
for this class.void
setMagic(int magic)
Set the magic number of the bytecode class.void
setMajorVersion(int major)
Set the major version of the bytecode class.void
setMinorVersion(int minor)
Set the minor version of the bytecode class.void
setSuperclassIndex(int index)
Set theConstantPool
index of theClassEntry
for 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:State
Return the magic number of the bytecode class.
-
setMagic
public void setMagic(int magic)
Description copied from class:State
Set the magic number of the bytecode class.
-
getMajorVersion
public int getMajorVersion()
Description copied from class:State
Return the major number of the bytecode class.- Overrides:
getMajorVersion
in classState
-
setMajorVersion
public void setMajorVersion(int major)
Description copied from class:State
Set the major version of the bytecode class.- Overrides:
setMajorVersion
in classState
-
getMinorVersion
public int getMinorVersion()
Description copied from class:State
Return the minor number of the bytecode class.- Overrides:
getMinorVersion
in classState
-
setMinorVersion
public void setMinorVersion(int minor)
Description copied from class:State
Set the minor version of the bytecode class.- Overrides:
setMinorVersion
in classState
-
getAccessFlags
public int getAccessFlags()
Description copied from class:State
Return the access flags of the bytecode class.- Overrides:
getAccessFlags
in classState
-
setAccessFlags
public void setAccessFlags(int access)
Description copied from class:State
Set the access flags of the bytecode class.- Overrides:
setAccessFlags
in classState
-
getIndex
public int getIndex()
Description copied from class:State
Return theConstantPool
index of theClassEntry
for this class, or 0 if none.
-
setIndex
public void setIndex(int index)
Description copied from class:State
Set theConstantPool
index of theClassEntry
for this class.
-
getSuperclassIndex
public int getSuperclassIndex()
Description copied from class:State
Return theConstantPool
index of theClassEntry
for the superclass of this class, or 0 if none.- Overrides:
getSuperclassIndex
in classState
-
setSuperclassIndex
public void setSuperclassIndex(int index)
Description copied from class:State
Set theConstantPool
index of theClassEntry
for the superclass of this class. ThrowsUnsupportedOperationException
by default.- Overrides:
setSuperclassIndex
in classState
-
getInterfacesHolder
public java.util.List getInterfacesHolder()
Description copied from class:State
Return theConstantPool
indexes of theClassEntry
s 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:
getInterfacesHolder
in classState
-
getFieldsHolder
public java.util.List getFieldsHolder()
Description copied from class:State
Return theBCField
s of this class, or empty list if none. If the state does not support changing the fields, the returned list should be immutable.- Overrides:
getFieldsHolder
in classState
-
getMethodsHolder
public java.util.List getMethodsHolder()
Description copied from class:State
Return theBCMethod
s of this class, or empty list if none. If the state does not support changing the methods, the returned list should be immutable.- Overrides:
getMethodsHolder
in classState
-
getAttributesHolder
public java.util.Collection getAttributesHolder()
Description copied from class:State
Return theAttribute
s of this class, or empty list if none. If the state does not support changing the attributes, the returned list should be immutable.- Overrides:
getAttributesHolder
in classState
-
getPool
public ConstantPool getPool()
Description copied from class:State
Return the constant pool of the class.
-
getName
public java.lang.String getName()
Description copied from class:State
Return 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:State
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.- Overrides:
getSuperclassName
in classState
-
getComponentName
public java.lang.String getComponentName()
Description copied from class:State
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.- Overrides:
getComponentName
in classState
-
isPrimitive
public boolean isPrimitive()
Description copied from class:State
Return true if this class is a primitive.- Overrides:
isPrimitive
in classState
-
-