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
Field
information from the underlyingJFieldVar
.
- See Also:
-
Constructor Summary
ConstructorDescriptionXJCJavaFieldImpl
(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 thisJavaField
is annotated with anAnnotation
matchingaClass
, return itsJavaAnnotation
representation.Return all of theAnnotations
for thisJavaField
.getDeclaredAnnotation
(JavaClass aClass) If thisJavaField
is annotated with anAnnotation
matchingaClass
, return itsJavaAnnotation
representation.Return all of theAnnotations
for thisJavaField
.int
Returns the Java language modifiers for thisJavaField
, encoded in an integer.getName()
Returns the name of thisJavaField
.Returns theJavaClass
which contains this field.Returns theJavaClass
representing the type of thisJavaField
.boolean
Indicates if thisJavaField
isabstract
.boolean
Indicates if thisJavaField
is anenum
constant - i.e.boolean
isFinal()
Indicates if thisJavaField
isfinal
.boolean
Indicates if thisJavaField
isprivate
.boolean
Indicates if thisJavaField
isprotected
.boolean
isPublic()
Indicates if thisJavaField
ispublic
.boolean
isStatic()
Indicates if thisJavaField
isstatic
.boolean
Not supported.void
setOwningClass
(JavaClass owningClass) Set theJavaClass
which 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 XJCJFieldVar
to be wrapped.codeModel
- - the XJCJCodeModel
this field belongs to.loader
- - theClassLoader
used to bootstrap theDynamicJAXBContext
.owner
- - theJavaClass
this field belongs to.
-
-
Method Details
-
getAnnotation
If thisJavaField
is annotated with anAnnotation
matchingaClass
, return itsJavaAnnotation
representation.- Specified by:
getAnnotation
in interfaceJavaHasAnnotations
- Parameters:
aClass
- aJavaClass
representing theAnnotation
to look for.- Returns:
- the
JavaAnnotation
represented byaClass
, if one exists, otherwise returnnull
.
-
getAnnotations
Return all of theAnnotations
for thisJavaField
.- Specified by:
getAnnotations
in interfaceJavaHasAnnotations
- Returns:
- A
Collection
containing thisJavaField's
JavaAnnotations
.
-
getModifiers
public int getModifiers()Returns the Java language modifiers for thisJavaField
, encoded in an integer.- Specified by:
getModifiers
in interfaceJavaField
- Returns:
- the
int
representing the modifiers for this field. - See Also:
-
getName
Returns the name of thisJavaField
. -
getResolvedType
Returns theJavaClass
representing the type of thisJavaField
.- Specified by:
getResolvedType
in interfaceJavaField
- Returns:
- the type of this
JavaField
as aJavaClass
.
-
isFinal
public boolean isFinal()Indicates if thisJavaField
isfinal
. -
isAbstract
public boolean isAbstract()Indicates if thisJavaField
isabstract
.- Specified by:
isAbstract
in interfaceJavaField
- Returns:
true
if thisJavaField
isabstract
, otherwisefalse
.
-
isPrivate
public boolean isPrivate()Indicates if thisJavaField
isprivate
. -
isProtected
public boolean isProtected()Indicates if thisJavaField
isprotected
.- Specified by:
isProtected
in interfaceJavaField
- Returns:
true
if thisJavaField
isprotected
, otherwisefalse
.
-
isPublic
public boolean isPublic()Indicates if thisJavaField
ispublic
. -
isStatic
public boolean isStatic()Indicates if thisJavaField
isstatic
. -
isSynthetic
public boolean isSynthetic()Not supported.- Specified by:
isSynthetic
in interfaceJavaField
-
isEnumConstant
public boolean isEnumConstant()Indicates if thisJavaField
is anenum
constant - i.e. its owner is anenum
.- Specified by:
isEnumConstant
in interfaceJavaField
- Returns:
true
if thisJavaField
is anenum
constant.
-
getDeclaredAnnotation
If thisJavaField
is annotated with anAnnotation
matchingaClass
, return itsJavaAnnotation
representation.- Specified by:
getDeclaredAnnotation
in interfaceJavaHasAnnotations
- Parameters:
aClass
- aJavaClass
representing theAnnotation
to look for.- Returns:
- the
JavaAnnotation
represented byaClass
, if one exists, otherwise returnnull
.
-
getDeclaredAnnotations
Return all of theAnnotations
for thisJavaField
.- Specified by:
getDeclaredAnnotations
in interfaceJavaHasAnnotations
- Returns:
- A
Collection
containing thisJavaField's
JavaAnnotations
.
-
setOwningClass
Set theJavaClass
which contains this field.- Parameters:
owningClass
- theJavaClass
representing the owner of thisJavaField
.
-
getOwningClass
Returns theJavaClass
which contains this field.- Returns:
JavaClass
representing the owner of thisJavaField
.
-