Interface JavaField

All Superinterfaces:
JavaAnnotatedElement, JavaMember, JavaModel, Serializable
All Known Implementing Classes:
DefaultJavaField

public interface JavaField extends JavaAnnotatedElement, JavaMember, JavaModel
Modeled equivalent of Field, providing the most important methods. Where the original Field is using an Array, this model is using a List.
  • Method Details

    • getType

      JavaClass getType()
      Equivalent of Field.getType()
      Returns:
      the type of this field, should never be null.
    • getCodeBlock

      String getCodeBlock()
      The in-code representation of this field.
      Specified by:
      getCodeBlock in interface JavaModel
      Returns:
      the complete representation of this field
    • getInitializationExpression

      String getInitializationExpression()
      Get the original expression used to initialize the field.
      Returns:
      initialization as string.
    • isEnumConstant

      boolean isEnumConstant()
      Returns:
      true if this field is an enum constant, otherwise false
      Since:
      2.0
    • getEnumConstantClass

      JavaClass getEnumConstantClass()
      Returns:
      the classBody of the enum constant
      Since:
      2.0
    • getEnumConstantArguments

      List<Expression> getEnumConstantArguments()
      Returns:
      the arguments of the enum constant
      Since:
      2.0