public class XJCJavaFieldImpl extends java.lang.Object implements JavaField
Purpose: JavaField implementation wrapping XJC's JFieldVar. Used when
bootstrapping a DynamicJAXBContext from an XML Schema.
Responsibilities:
Field information from the underlying JFieldVar.JavaField| Constructor and Description |
|---|
XJCJavaFieldImpl(JFieldVar javaField,
JCodeModel codeModel,
DynamicClassLoader loader,
JavaClass owner)
Construct a new instance of
XJCJavaFieldImpl. |
| Modifier and Type | Method and Description |
|---|---|
JavaAnnotation |
getAnnotation(JavaClass aClass)
If this
JavaField is annotated with an Annotation matching aClass,
return its JavaAnnotation representation. |
java.util.Collection<JavaAnnotation> |
getAnnotations()
Return all of the
Annotations for this JavaField. |
JavaAnnotation |
getDeclaredAnnotation(JavaClass aClass)
If this
JavaField is annotated with an Annotation matching aClass,
return its JavaAnnotation representation. |
java.util.Collection<JavaAnnotation> |
getDeclaredAnnotations()
Return all of the
Annotations for this JavaField. |
int |
getModifiers()
Returns the Java language modifiers for this
JavaField, encoded in an integer. |
java.lang.String |
getName()
Returns the name of this
JavaField. |
JavaClass |
getOwningClass()
Returns the
JavaClass which contains this field. |
JavaClass |
getResolvedType()
Returns the
JavaClass representing the type of this JavaField. |
boolean |
isAbstract()
Indicates if this
JavaField is abstract. |
boolean |
isEnumConstant()
Indicates if this
JavaField is an enum constant - i.e. its owner is an enum. |
boolean |
isFinal()
Indicates if this
JavaField is final. |
boolean |
isPrivate()
Indicates if this
JavaField is private. |
boolean |
isProtected()
Indicates if this
JavaField is protected. |
boolean |
isPublic()
Indicates if this
JavaField is public. |
boolean |
isStatic()
Indicates if this
JavaField is static. |
boolean |
isSynthetic()
Not supported.
|
void |
setOwningClass(JavaClass owningClass)
Set the
JavaClass which contains this field. |
public XJCJavaFieldImpl(JFieldVar javaField,
JCodeModel codeModel,
DynamicClassLoader loader,
JavaClass owner)
XJCJavaFieldImpl.javaField - - the XJC JFieldVar to be wrapped.codeModel - - the XJC JCodeModel this field belongs to.loader - - the ClassLoader used to bootstrap the DynamicJAXBContext.owner - - the JavaClass this field belongs to.public JavaAnnotation getAnnotation(JavaClass aClass)
JavaField is annotated with an Annotation matching aClass,
return its JavaAnnotation representation.getAnnotation in interface JavaHasAnnotationsaClass - a JavaClass representing the Annotation to look for.JavaAnnotation represented by aClass, if one exists, otherwise return null.public java.util.Collection<JavaAnnotation> getAnnotations()
Annotations for this JavaField.getAnnotations in interface JavaHasAnnotationsCollection containing this JavaField's JavaAnnotations.public int getModifiers()
JavaField, encoded in an integer.getModifiers in interface JavaFieldint representing the modifiers for this field.Modifierpublic java.lang.String getName()
JavaField.public JavaClass getResolvedType()
JavaClass representing the type of this JavaField.getResolvedType in interface JavaFieldJavaField as a JavaClass.public boolean isFinal()
JavaField is final.public boolean isAbstract()
JavaField is abstract.isAbstract in interface JavaFieldtrue if this JavaField is abstract, otherwise false.public boolean isPrivate()
JavaField is private.public boolean isProtected()
JavaField is protected.isProtected in interface JavaFieldtrue if this JavaField is protected, otherwise false.public boolean isPublic()
JavaField is public.public boolean isStatic()
JavaField is static.public boolean isSynthetic()
isSynthetic in interface JavaFieldpublic boolean isEnumConstant()
JavaField is an enum constant - i.e. its owner is an enum.isEnumConstant in interface JavaFieldtrue if this JavaField is an enum constant.public JavaAnnotation getDeclaredAnnotation(JavaClass aClass)
JavaField is annotated with an Annotation matching aClass,
return its JavaAnnotation representation.getDeclaredAnnotation in interface JavaHasAnnotationsaClass - a JavaClass representing the Annotation to look for.JavaAnnotation represented by aClass, if one exists, otherwise return null.public java.util.Collection<JavaAnnotation> getDeclaredAnnotations()
Annotations for this JavaField.getDeclaredAnnotations in interface JavaHasAnnotationsCollection containing this JavaField's JavaAnnotations.public void setOwningClass(JavaClass owningClass)
JavaClass which contains this field.owningClass - the JavaClass representing the owner of this JavaField.public JavaClass getOwningClass()
JavaClass which contains this field.JavaClass representing the owner of this JavaField.