Class RefConstant

All Implemented Interfaces:
Serializable, Processable
Direct Known Subclasses:
AnyMethodrefConstant, FieldrefConstant

public abstract class RefConstant extends Constant
This Constant represents a ref constant in the constant pool.
See Also:
  • Field Details

    • u2classIndex

      public int u2classIndex
    • u2nameAndTypeIndex

      public int u2nameAndTypeIndex
    • referencedClass

      public Clazz referencedClass
      An extra field pointing to the referenced Clazz object. This field is typically filled out by the ClassReferenceInitializer.
  • Constructor Details

    • RefConstant

      protected RefConstant()
      Creates an uninitialized RefConstant.
  • Method Details

    • getClassIndex

      public int getClassIndex()
      Returns the class index.
    • getNameAndTypeIndex

      public int getNameAndTypeIndex()
      Returns the name-and-type index.
    • setNameAndTypeIndex

      public void setNameAndTypeIndex(int index)
      Sets the name-and-type index.
    • getClassName

      public String getClassName(Clazz clazz)
      Returns the class name.
    • getName

      public String getName(Clazz clazz)
      Returns the method/field name.
    • getType

      public String getType(Clazz clazz)
      Returns the type.
    • referencedClassAccept

      public void referencedClassAccept(ClassVisitor classVisitor)
      Lets the referenced class accept the given visitor.
    • referencedMemberAccept

      public abstract void referencedMemberAccept(MemberVisitor memberVisitor)
      Lets the referenced class member accept the given visitor.
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object