Package serp.bytecode

Class ObjectState


  • class ObjectState
    extends State
    State implementing the behavior of an object type.
    • Field Detail

      • _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.
        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
      • 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 java.util.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 java.util.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 java.util.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 java.util.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 java.lang.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 java.lang.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 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 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