Module org.eclipse.persistence.moxy
Class XJCJavaFieldImpl
java.lang.Object
org.eclipse.persistence.jaxb.javamodel.xjc.XJCJavaFieldImpl
- All Implemented Interfaces:
JavaField,JavaHasAnnotations
INTERNAL:
Purpose: JavaField implementation wrapping XJC's JFieldVar. Used when
bootstrapping a DynamicJAXBContext from an XML Schema.
Responsibilities:
- Provide
Fieldinformation from the underlyingJFieldVar.
- Since:
- EclipseLink 2.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionXJCJavaFieldImpl(com.sun.codemodel.JFieldVar javaField, com.sun.codemodel.JCodeModel codeModel, DynamicClassLoader loader, JavaClass owner) Construct a new instance ofXJCJavaFieldImpl. -
Method Summary
Modifier and TypeMethodDescriptiongetAnnotation(JavaClass aClass) If thisJavaFieldis annotated with anAnnotationmatchingaClass, return itsJavaAnnotationrepresentation.Return all of theAnnotationsfor thisJavaField.getDeclaredAnnotation(JavaClass aClass) If thisJavaFieldis annotated with anAnnotationmatchingaClass, return itsJavaAnnotationrepresentation.Return all of theAnnotationsfor thisJavaField.intReturns the Java language modifiers for thisJavaField, encoded in an integer.getName()Returns the name of thisJavaField.Returns theJavaClasswhich contains this field.Returns theJavaClassrepresenting the type of thisJavaField.booleanIndicates if thisJavaFieldisabstract.booleanIndicates if thisJavaFieldis anenumconstant - i.e.booleanisFinal()Indicates if thisJavaFieldisfinal.booleanIndicates if thisJavaFieldisprivate.booleanIndicates if thisJavaFieldisprotected.booleanisPublic()Indicates if thisJavaFieldispublic.booleanisStatic()Indicates if thisJavaFieldisstatic.booleanNot supported.voidsetOwningClass(JavaClass owningClass) Set theJavaClasswhich contains this field.
-
Constructor Details
-
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 Details
-
getAnnotation
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
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:
-
getName
Returns the name of thisJavaField. -
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
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
Return all of theAnnotationsfor thisJavaField.- Specified by:
getDeclaredAnnotationsin interfaceJavaHasAnnotations- Returns:
- A
Collectioncontaining thisJavaField'sJavaAnnotations.
-
setOwningClass
Set theJavaClasswhich contains this field.- Parameters:
owningClass- theJavaClassrepresenting the owner of thisJavaField.
-
getOwningClass
Returns theJavaClasswhich contains this field.- Returns:
JavaClassrepresenting the owner of thisJavaField.
-