Interface IJavaField

All Superinterfaces:
IJavaDecompilableElement, IJavaElement

@Ser public interface IJavaField extends IJavaDecompilableElement
Java AST interface to represent a Java field.
  • Method Details

    • getAccessFlags

      int getAccessFlags()
      Returns:
    • isStatic

      boolean isStatic()
      Determine whether or not this field is static.
      Returns:
      true if static
    • isSynthetic

      boolean isSynthetic()
      Returns:
    • getClassType

      IJavaType getClassType()
      Returns:
    • getType

      IJavaType getType()
      Get the field type.
      Returns:
      the type string
    • getName

      String getName()
      Get the original field name.
      Specified by:
      getName in interface IJavaDecompilableElement
      Returns:
      the name
    • getSignature

      String getSignature()
      Get the field signature. Convenience routine.

      Format: classSignature->fieldName:type

      Specified by:
      getSignature in interface IJavaDecompilableElement
      Returns:
      the field signature, or null for the pseudo-fields "[].length" and "Class.class"
    • getInitialValue

      IJavaExpression getInitialValue()
      Get the static initialization value, if any. Only for static fields.
      Returns:
      the initial value, or null if none
    • getAnnotations

      List<IJavaAnnotation> getAnnotations()
      Returns:
    • generateName

      void generateName(JavaOutputSink out, boolean definition)
      Parameters:
      out -
      definition -
    • generateName

      void generateName(JavaOutputSink out, boolean definition, String alternateName, boolean generated)
      Parameters:
      out -
      definition -
      alternateName - alternate name (AST only, dynamically provided by the caller, not persisted) to be used if and only if the DCM cannot provide a better name (eg, the field was renamed at the DEX level)
      generated - true to render the field name with ItemClassIdentifiers.FIELD_NAME_GENERATED instead of ItemClassIdentifiers.FIELD_NAME
    • duplicate

      IJavaField duplicate()
      Description copied from interface: IJavaElement
      Duplicate this element.
      Specified by:
      duplicate in interface IJavaDecompilableElement
      Specified by:
      duplicate in interface IJavaElement
      Returns:
      a (possibly) duplicated object of the same type