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 Details

    • _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 List _interfaces
    • _fields

      private final List _fields
    • _methods

      private final List _methods
    • _attributes

      private final List _attributes
  • Constructor Details

    • ObjectState

      public ObjectState(NameCache names)
  • Method Details

    • getMagic

      public int getMagic()
      Description copied from class: State
      Return the magic number of the bytecode class.
      Overrides:
      getMagic in class State
    • setMagic

      public void setMagic(int magic)
      Description copied from class: State
      Set the magic number of the bytecode class.
      Overrides:
      setMagic in class State
    • getMajorVersion

      public int getMajorVersion()
      Description copied from class: State
      Return the major number of the bytecode class.
      Overrides:
      getMajorVersion in class State
    • setMajorVersion

      public void setMajorVersion(int major)
      Description copied from class: State
      Set the major version of the bytecode class.
      Overrides:
      setMajorVersion in class State
    • getMinorVersion

      public int getMinorVersion()
      Description copied from class: State
      Return the minor number of the bytecode class.
      Overrides:
      getMinorVersion in class State
    • setMinorVersion

      public void setMinorVersion(int minor)
      Description copied from class: State
      Set the minor version of the bytecode class.
      Overrides:
      setMinorVersion in class State
    • getAccessFlags

      public int getAccessFlags()
      Description copied from class: State
      Return the access flags of the bytecode class.
      Overrides:
      getAccessFlags in class State
    • setAccessFlags

      public void setAccessFlags(int access)
      Description copied from class: State
      Set the access flags of the bytecode class.
      Overrides:
      setAccessFlags in class State
    • getIndex

      public int getIndex()
      Description copied from class: State
      Return the ConstantPool index of the ClassEntry for this class, or 0 if none.
      Overrides:
      getIndex in class State
    • setIndex

      public void setIndex(int index)
      Description copied from class: State
      Set the ConstantPool index of the ClassEntry for this class.
      Overrides:
      setIndex in class State
    • getSuperclassIndex

      public int getSuperclassIndex()
      Description copied from class: State
      Return the ConstantPool index of the ClassEntry for the superclass of this class, or 0 if none.
      Overrides:
      getSuperclassIndex in class State
    • setSuperclassIndex

      public void setSuperclassIndex(int index)
      Description copied from class: State
      Set the ConstantPool index of the ClassEntry for the superclass of this class. Throws UnsupportedOperationException by default.
      Overrides:
      setSuperclassIndex in class State
    • getInterfacesHolder

      public List getInterfacesHolder()
      Description copied from class: State
      Return the ConstantPool indexes of the ClassEntrys 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 class State
    • getFieldsHolder

      public List getFieldsHolder()
      Description copied from class: State
      Return the BCFields 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 class State
    • getMethodsHolder

      public List getMethodsHolder()
      Description copied from class: State
      Return the BCMethods 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 class State
    • getAttributesHolder

      public Collection getAttributesHolder()
      Description copied from class: State
      Return the Attributes 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 class State
    • getPool

      public ConstantPool getPool()
      Description copied from class: State
      Return the constant pool of the class.
      Overrides:
      getPool in class State
    • getName

      public String getName()
      Description copied from class: State
      Return the name of the class. The name should be in a form suitable for a Class.forName(java.lang.String) call.
      Overrides:
      getName in class State
    • getSuperclassName

      public String getSuperclassName()
      Description copied from class: State
      Return the name of the superclass. The name should be in a form suitable for a Class.forName(java.lang.String) call, or null if none.
      Overrides:
      getSuperclassName in class State
    • getComponentName

      public 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 a Class.forName(java.lang.String) call.
      Overrides:
      getComponentName in class State
    • isPrimitive

      public boolean isPrimitive()
      Description copied from class: State
      Return true if this class is a primitive.
      Overrides:
      isPrimitive in class State
    • isArray

      public boolean isArray()
      Description copied from class: State
      Return true if this class is an array.
      Overrides:
      isArray in class State