Interface FieldInfo

  • All Known Implementing Classes:
    Field

    public interface FieldInfo
    FieldInfo grants access to a field's name and type (represented as indices into the constant pool), as well as its modifiers. FieldInfo is implemented in file.Field.
    See Also:
    Field
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int constantValue()
      Get the index into the constant pool of the field's constant value, if any.
      ClassInfo declaringClass()
      Get the class which declared the field.
      int modifiers()
      Get the modifiers of the field.
      int nameIndex()
      Get the index into the constant pool of the name of the field.
      void setConstantValue​(int index)
      Set the index into the constant pool of the field's constant value.
      void setModifiers​(int modifiers)
      Set the modifiers of the field.
      void setNameIndex​(int index)
      Set the index into the constant pool of the name of the field.
      void setTypeIndex​(int index)
      Set the index into the constant pool of the type of the field.
      int typeIndex()
      Get the index into the constant pool of the type of the field.
    • Method Detail

      • declaringClass

        ClassInfo declaringClass()
        Get the class which declared the field.
        Returns:
        The ClassInfo of the class which declared the field.
      • nameIndex

        int nameIndex()
        Get the index into the constant pool of the name of the field.
        Returns:
        The index into the constant pool of the name of the field.
      • typeIndex

        int typeIndex()
        Get the index into the constant pool of the type of the field.
        Returns:
        The index into the constant pool of the type of the field.
      • setNameIndex

        void setNameIndex​(int index)
        Set the index into the constant pool of the name of the field.
        Parameters:
        index - The index into the constant pool of the name of the field.
      • setTypeIndex

        void setTypeIndex​(int index)
        Set the index into the constant pool of the type of the field.
        Parameters:
        index - The index into the constant pool of the type of the field.
      • setModifiers

        void setModifiers​(int modifiers)
        Set the modifiers of the field. The values correspond to the constants in the Modifiers class.
        Parameters:
        modifiers - A bit vector of modifier flags for the field.
        See Also:
        Modifiers
      • modifiers

        int modifiers()
        Get the modifiers of the field. The values correspond to the constants in the Modifiers class.
        Returns:
        A bit vector of modifier flags for the field.
        See Also:
        Modifiers
      • constantValue

        int constantValue()
        Get the index into the constant pool of the field's constant value, if any. Returns 0 if the field does not have a constant value.
        See Also:
        ClassInfo.constants()
      • setConstantValue

        void setConstantValue​(int index)
        Set the index into the constant pool of the field's constant value.
        See Also:
        ClassInfo.constants()