Class XJCJavaFieldImpl
- java.lang.Object
-
- org.eclipse.persistence.jaxb.javamodel.xjc.XJCJavaFieldImpl
-
- All Implemented Interfaces:
JavaField,JavaHasAnnotations
public class XJCJavaFieldImpl extends java.lang.Object implements JavaField
INTERNAL:Purpose:
JavaFieldimplementation wrapping XJC'sJFieldVar. Used when bootstrapping aDynamicJAXBContextfrom an XML Schema.Responsibilities:
- Provide
Fieldinformation from the underlyingJFieldVar.
- See Also:
JavaField- Since:
- EclipseLink 2.1
-
-
Constructor Summary
Constructors Constructor Description XJCJavaFieldImpl(com.sun.codemodel.JFieldVar javaField, com.sun.codemodel.JCodeModel codeModel, DynamicClassLoader loader, JavaClass owner)Construct a new instance ofXJCJavaFieldImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaAnnotationgetAnnotation(JavaClass aClass)If thisJavaFieldis annotated with anAnnotationmatchingaClass, return itsJavaAnnotationrepresentation.java.util.Collection<JavaAnnotation>getAnnotations()Return all of theAnnotationsfor thisJavaField.JavaAnnotationgetDeclaredAnnotation(JavaClass aClass)If thisJavaFieldis annotated with anAnnotationmatchingaClass, return itsJavaAnnotationrepresentation.java.util.Collection<JavaAnnotation>getDeclaredAnnotations()Return all of theAnnotationsfor thisJavaField.intgetModifiers()Returns the Java language modifiers for thisJavaField, encoded in an integer.java.lang.StringgetName()Returns the name of thisJavaField.JavaClassgetOwningClass()Returns theJavaClasswhich contains this field.JavaClassgetResolvedType()Returns theJavaClassrepresenting the type of thisJavaField.booleanisAbstract()Indicates if thisJavaFieldisabstract.booleanisEnumConstant()Indicates if thisJavaFieldis anenumconstant - i.e. its owner is anenum.booleanisFinal()Indicates if thisJavaFieldisfinal.booleanisPrivate()Indicates if thisJavaFieldisprivate.booleanisProtected()Indicates if thisJavaFieldisprotected.booleanisPublic()Indicates if thisJavaFieldispublic.booleanisStatic()Indicates if thisJavaFieldisstatic.booleanisSynthetic()Not supported.voidsetOwningClass(JavaClass owningClass)Set theJavaClasswhich contains this field.
-
-
-
Constructor Detail
-
XJCJavaFieldImpl
public XJCJavaFieldImpl(com.sun.codemodel.JFieldVar javaField, com.sun.codemodel.JCodeModel codeModel, DynamicClassLoader loader, JavaClass owner)Construct a new instance ofXJCJavaFieldImpl.- Parameters:
javaField- - the XJCJFieldVarto be wrapped.codeModel- - the XJCJCodeModelthis field belongs to.loader- - theClassLoaderused to bootstrap theDynamicJAXBContext.owner- - theJavaClassthis field belongs to.
-
-
Method Detail
-
getAnnotation
public JavaAnnotation getAnnotation(JavaClass aClass)
If thisJavaFieldis annotated with anAnnotationmatchingaClass, return itsJavaAnnotationrepresentation.- Specified by:
getAnnotationin interfaceJavaHasAnnotations- Parameters:
aClass- aJavaClassrepresenting theAnnotationto look for.- Returns:
- the
JavaAnnotationrepresented byaClass, if one exists, otherwise returnnull.
-
getAnnotations
public java.util.Collection<JavaAnnotation> getAnnotations()
Return all of theAnnotationsfor thisJavaField.- Specified by:
getAnnotationsin interfaceJavaHasAnnotations- Returns:
- A
Collectioncontaining thisJavaField'sJavaAnnotations.
-
getModifiers
public int getModifiers()
Returns the Java language modifiers for thisJavaField, encoded in an integer.- Specified by:
getModifiersin interfaceJavaField- Returns:
- the
intrepresenting the modifiers for this field. - See Also:
Modifier
-
getName
public java.lang.String getName()
Returns the name of thisJavaField.
-
getResolvedType
public JavaClass getResolvedType()
Returns theJavaClassrepresenting the type of thisJavaField.- Specified by:
getResolvedTypein interfaceJavaField- Returns:
- the type of this
JavaFieldas aJavaClass.
-
isFinal
public boolean isFinal()
Indicates if thisJavaFieldisfinal.
-
isAbstract
public boolean isAbstract()
Indicates if thisJavaFieldisabstract.- Specified by:
isAbstractin interfaceJavaField- Returns:
trueif thisJavaFieldisabstract, otherwisefalse.
-
isPrivate
public boolean isPrivate()
Indicates if thisJavaFieldisprivate.
-
isProtected
public boolean isProtected()
Indicates if thisJavaFieldisprotected.- Specified by:
isProtectedin interfaceJavaField- Returns:
trueif thisJavaFieldisprotected, otherwisefalse.
-
isPublic
public boolean isPublic()
Indicates if thisJavaFieldispublic.
-
isStatic
public boolean isStatic()
Indicates if thisJavaFieldisstatic.
-
isSynthetic
public boolean isSynthetic()
Not supported.- Specified by:
isSyntheticin interfaceJavaField
-
isEnumConstant
public boolean isEnumConstant()
Indicates if thisJavaFieldis anenumconstant - i.e. its owner is anenum.- Specified by:
isEnumConstantin interfaceJavaField- Returns:
trueif thisJavaFieldis anenumconstant.
-
getDeclaredAnnotation
public JavaAnnotation getDeclaredAnnotation(JavaClass aClass)
If thisJavaFieldis annotated with anAnnotationmatchingaClass, return itsJavaAnnotationrepresentation.- Specified by:
getDeclaredAnnotationin interfaceJavaHasAnnotations- Parameters:
aClass- aJavaClassrepresenting theAnnotationto look for.- Returns:
- the
JavaAnnotationrepresented byaClass, if one exists, otherwise returnnull.
-
getDeclaredAnnotations
public java.util.Collection<JavaAnnotation> getDeclaredAnnotations()
Return all of theAnnotationsfor thisJavaField.- Specified by:
getDeclaredAnnotationsin interfaceJavaHasAnnotations- Returns:
- A
Collectioncontaining thisJavaField'sJavaAnnotations.
-
setOwningClass
public void setOwningClass(JavaClass owningClass)
Set theJavaClasswhich contains this field.- Parameters:
owningClass- theJavaClassrepresenting the owner of thisJavaField.
-
getOwningClass
public JavaClass getOwningClass()
Returns theJavaClasswhich contains this field.- Returns:
JavaClassrepresenting the owner of thisJavaField.
-
-