public class JField extends Object implements JField
Modifier and Type | Method and Description |
---|---|
<T extends Annotation> |
getAnnotation(Class<T> annotationClass)
Returns an instance of the specified annotation type if it is present on
this element or
null if it is not. |
Annotation[] |
getAnnotations()
Returns all the annotations present on this element.
|
Annotation[] |
getDeclaredAnnotations()
Returns the annotations declared directly on this element; does not include
any inherited annotations.
|
JClassType |
getEnclosingType() |
String[][] |
getMetaData(String tagName)
Deprecated.
|
String[] |
getMetaDataTags()
Deprecated.
|
String |
getName() |
JType |
getType() |
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationClass)
Returns
true if this item has an annotation of the specified
type. |
boolean |
isDefaultAccess() |
JEnumConstant |
isEnumConstant() |
boolean |
isFinal() |
boolean |
isPrivate() |
boolean |
isProtected() |
boolean |
isPublic() |
boolean |
isStatic() |
boolean |
isTransient() |
boolean |
isVolatile() |
String |
toString() |
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
HasAnnotations
null
if it is not. For a class, this will
look for annotations on supertypes as well.getAnnotation
in interface HasAnnotations
annotationClass
- annotation type to search fornull
if it is notpublic Annotation[] getAnnotations()
HasAnnotations
getAnnotations
in interface HasAnnotations
public Annotation[] getDeclaredAnnotations()
HasAnnotations
getDeclaredAnnotations
in interface HasAnnotations
public JClassType getEnclosingType()
getEnclosingType
in interface JField
@Deprecated public final String[][] getMetaData(String tagName)
HasMetaData
getMetaData
in interface HasMetaData
@Deprecated public final String[] getMetaDataTags()
HasMetaData
getMetaDataTags
in interface HasMetaData
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
HasAnnotations
true
if this item has an annotation of the specified
type. For a class, this will look at supertypes as well.isAnnotationPresent
in interface HasAnnotations
true
if this item has an annotation of the specified
typepublic boolean isDefaultAccess()
isDefaultAccess
in interface JField
public JEnumConstant isEnumConstant()
isEnumConstant
in interface JField
public boolean isProtected()
isProtected
in interface JField
public boolean isTransient()
isTransient
in interface JField
public boolean isVolatile()
isVolatile
in interface JField
Copyright © 2018. All rights reserved.