Package serp.bytecode

Class BCField

All Implemented Interfaces:
BCEntity, VisitAcceptor

public class BCField extends BCMember implements VisitAcceptor
A field of a class.
Author:
Abe White
  • Method Details

    • isVolatile

      public boolean isVolatile()
      Manipulate the field access flags.
    • setVolatile

      public void setVolatile(boolean on)
      Manipulate the field access flags.
    • isTransient

      public boolean isTransient()
      Manipulate the field access flags.
    • setTransient

      public void setTransient(boolean on)
      Manipulate the field access flags.
    • isEnum

      public boolean isEnum()
      Manipulate the field access flags. Defaults to true for fields added to enum classes.
    • setEnum

      public void setEnum(boolean on)
      Manipulate the field access flags. Defaults to true for fields added to enum classes.
    • getTypeName

      public String getTypeName()
      Return the name of the type of this field. The name will be given in a form suitable for a Class.forName(java.lang.String) call.
      See Also:
    • getType

      public Class getType()
      Return the Class object for the type of this field.
    • getTypeBC

      public BCClass getTypeBC()
      Return the bytecode for the type of this field.
    • setType

      public void setType(String type)
      Set the name of the type of this field.
      See Also:
    • setType

      public void setType(Class type)
      Set the type of this field.
      See Also:
    • setType

      public void setType(BCClass type)
      Set the type of this field.
      See Also:
    • getConstantValue

      public ConstantValue getConstantValue(boolean add)
      Return the constant value information for the field. Acts internally through the Attributes interface.
      Parameters:
      add - if true, a new constant value attribute will be added if not already present
      Returns:
      the constant value information, or null if none and the add param is set to false
    • removeConstantValue

      public boolean removeConstantValue()
      Remove the constant value attribute for the field. Acts internally through the Attributes interface.
      Returns:
      true if there was a value to remove
    • acceptVisit

      public void acceptVisit(BCVisitor visit)
      Description copied from interface: VisitAcceptor
      Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this one.
      Specified by:
      acceptVisit in interface VisitAcceptor