Class JavaSourceField
- java.lang.Object
-
- gw.lang.reflect.java.JavaSourceElement
-
- gw.internal.gosu.parser.java.classinfo.JavaSourceField
-
- All Implemented Interfaces:
IJavaAnnotatedElement,IJavaClassField,java.io.Serializable
- Direct Known Subclasses:
JavaSourceEnumConstant
public class JavaSourceField extends JavaSourceElement implements IJavaClassField
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected JavaSourceType_containingClassprotected com.sun.source.tree.VariableTree_fieldTreeprotected IJavaClassType_genericTypeprotected IModifierList_modifierListprotected IJavaClassInfo_type
-
Constructor Summary
Constructors Constructor Description JavaSourceField(com.sun.source.tree.VariableTree fieldTree, JavaSourceType containingClass)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JavaSourceFieldcreate(com.sun.source.tree.VariableTree fieldTree, JavaSourceType containingType)IAnnotationInfogetAnnotation(java.lang.Class annotationClass)Returns this element's annotation for the specified type if such an annotation is present, else null.IAnnotationInfo[]getDeclaredAnnotations()Returns all annotations that are directly present on this element.JavaSourceTypegetEnclosingClass()IJavaClassTypegetGenericType()IModifierListgetModifierList()intgetModifiers()java.lang.StringgetName()java.lang.StringgetRhs()com.sun.source.tree.TreegetTree()IJavaClassInfogetType()booleanisAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)Returns true if an annotation for the specified type is present on this element, else false.booleanisEnumConstant()static booleanisEnumInit(com.sun.source.tree.VariableTree tree)booleanisSynthetic()java.lang.StringtoString()-
Methods inherited from class gw.lang.reflect.java.JavaSourceElement
findInnerSourceType, getCompilationUnitTree, getDeclaringClass, getEndPosition, getLocationInfo, getSourcePositions, getStartPosition
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.reflect.java.IJavaAnnotatedElement
getLocationInfo
-
-
-
-
Field Detail
-
_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 Detail
-
JavaSourceField
public JavaSourceField(com.sun.source.tree.VariableTree fieldTree, JavaSourceType containingClass)
-
-
Method Detail
-
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 java.lang.String getName()
- Specified by:
getNamein interfaceIJavaClassField
-
getRhs
public java.lang.String getRhs()
-
getType
public IJavaClassInfo getType()
- Specified by:
getTypein interfaceIJavaClassField
-
getGenericType
public IJavaClassType getGenericType()
- Specified by:
getGenericTypein interfaceIJavaClassField
-
isEnumConstant
public boolean isEnumConstant()
- Specified by:
isEnumConstantin interfaceIJavaClassField
-
getModifierList
public IModifierList getModifierList()
-
getEnclosingClass
public JavaSourceType getEnclosingClass()
- Specified by:
getEnclosingClassin interfaceIJavaAnnotatedElement- Specified by:
getEnclosingClassin classJavaSourceElement
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isSynthetic
public boolean isSynthetic()
- Specified by:
isSyntheticin interfaceIJavaClassField
-
getModifiers
public int getModifiers()
- Specified by:
getModifiersin interfaceIJavaClassField
-
isAnnotationPresent
public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Description copied from interface:IJavaAnnotatedElementReturns 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:
isAnnotationPresentin interfaceIJavaAnnotatedElement- 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(java.lang.Class annotationClass)
Description copied from interface:IJavaAnnotatedElementReturns this element's annotation for the specified type if such an annotation is present, else null.- Specified by:
getAnnotationin interfaceIJavaAnnotatedElement- 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:IJavaAnnotatedElementReturns 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:
getDeclaredAnnotationsin interfaceIJavaAnnotatedElement- Returns:
- All annotations directly present on this element
-
getTree
public com.sun.source.tree.Tree getTree()
- Specified by:
getTreein classJavaSourceElement
-
-