Class JavaSourceField

java.lang.Object
gw.lang.reflect.java.JavaSourceElement
gw.internal.gosu.parser.java.classinfo.JavaSourceField
All Implemented Interfaces:
IJavaAnnotatedElement, IJavaClassField, Serializable
Direct Known Subclasses:
JavaSourceEnumConstant

public class JavaSourceField extends JavaSourceElement implements IJavaClassField
See Also:
  • Field Details

    • _fieldTree

      protected com.sun.source.tree.VariableTree _fieldTree
    • _containingClass

      protected JavaSourceType _containingClass
    • _modifierList

      protected IModifierList _modifierList
    • _type

      protected IJavaClassInfo _type
    • _genericType

      protected IJavaClassType _genericType
  • Constructor Details

    • JavaSourceField

      public JavaSourceField(com.sun.source.tree.VariableTree fieldTree, JavaSourceType containingClass)
  • Method Details

    • create

      public static JavaSourceField create(com.sun.source.tree.VariableTree fieldTree, JavaSourceType containingType)
    • isEnumInit

      public static boolean isEnumInit(com.sun.source.tree.VariableTree tree)
    • getName

      public String getName()
      Specified by:
      getName in interface IJavaClassField
    • getRhs

      public String getRhs()
    • getType

      public IJavaClassInfo getType()
      Specified by:
      getType in interface IJavaClassField
    • getGenericType

      public IJavaClassType getGenericType()
      Specified by:
      getGenericType in interface IJavaClassField
    • isEnumConstant

      public boolean isEnumConstant()
      Specified by:
      isEnumConstant in interface IJavaClassField
    • getModifierList

      public IModifierList getModifierList()
    • getEnclosingClass

      public JavaSourceType getEnclosingClass()
      Specified by:
      getEnclosingClass in interface IJavaAnnotatedElement
      Specified by:
      getEnclosingClass in class JavaSourceElement
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isSynthetic

      public boolean isSynthetic()
      Specified by:
      isSynthetic in interface IJavaClassField
    • getModifiers

      public int getModifiers()
      Specified by:
      getModifiers in interface IJavaClassField
    • isAnnotationPresent

      public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
      Description copied from interface: IJavaAnnotatedElement
      Returns true if an annotation for the specified type is present on this element, else false. This method is designed primarily for convenient access to marker annotations.
      Specified by:
      isAnnotationPresent in interface IJavaAnnotatedElement
      Parameters:
      annotationClass - the Class object corresponding to the annotation type
      Returns:
      true if an annotation for the specified annotation type is present on this element, else false
    • getAnnotation

      public IAnnotationInfo getAnnotation(Class annotationClass)
      Description copied from interface: IJavaAnnotatedElement
      Returns this element's annotation for the specified type if such an annotation is present, else null.
      Specified by:
      getAnnotation in interface IJavaAnnotatedElement
      Parameters:
      annotationClass - the Class object corresponding to the annotation type
      Returns:
      this element's annotation for the specified annotation type if present on this element, else null
    • getDeclaredAnnotations

      public IAnnotationInfo[] getDeclaredAnnotations()
      Description copied from interface: IJavaAnnotatedElement
      Returns all annotations that are directly present on this element. Unlike the other methods in this interface, this method ignores inherited annotations. (Returns an array of length zero if no annotations are directly present on this element.) The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.
      Specified by:
      getDeclaredAnnotations in interface IJavaAnnotatedElement
      Returns:
      All annotations directly present on this element
    • getTree

      public com.sun.source.tree.Tree getTree()
      Specified by:
      getTree in class JavaSourceElement