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:
JavaField
implementation wrapping XJC'sJFieldVar
. Used when bootstrapping aDynamicJAXBContext
from an XML Schema.Responsibilities:
- Provide
Field
information 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 JavaAnnotation
getAnnotation(JavaClass aClass)
If thisJavaField
is annotated with anAnnotation
matchingaClass
, return itsJavaAnnotation
representation.java.util.Collection<JavaAnnotation>
getAnnotations()
Return all of theAnnotations
for thisJavaField
.JavaAnnotation
getDeclaredAnnotation(JavaClass aClass)
If thisJavaField
is annotated with anAnnotation
matchingaClass
, return itsJavaAnnotation
representation.java.util.Collection<JavaAnnotation>
getDeclaredAnnotations()
Return all of theAnnotations
for thisJavaField
.int
getModifiers()
Returns the Java language modifiers for thisJavaField
, encoded in an integer.java.lang.String
getName()
Returns the name of thisJavaField
.JavaClass
getOwningClass()
Returns theJavaClass
which contains this field.JavaClass
getResolvedType()
Returns theJavaClass
representing the type of thisJavaField
.boolean
isAbstract()
Indicates if thisJavaField
isabstract
.boolean
isEnumConstant()
Indicates if thisJavaField
is anenum
constant - i.e. its owner is anenum
.boolean
isFinal()
Indicates if thisJavaField
isfinal
.boolean
isPrivate()
Indicates if thisJavaField
isprivate
.boolean
isProtected()
Indicates if thisJavaField
isprotected
.boolean
isPublic()
Indicates if thisJavaField
ispublic
.boolean
isStatic()
Indicates if thisJavaField
isstatic
.boolean
isSynthetic()
Not supported.void
setOwningClass(JavaClass owningClass)
Set theJavaClass
which 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 XJCJFieldVar
to be wrapped.codeModel
- - the XJCJCodeModel
this field belongs to.loader
- - theClassLoader
used to bootstrap theDynamicJAXBContext
.owner
- - theJavaClass
this field belongs to.
-
-
Method Detail
-
getAnnotation
public JavaAnnotation getAnnotation(JavaClass aClass)
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
public java.util.Collection<JavaAnnotation> 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:
Modifier
-
getName
public java.lang.String getName()
Returns the name of thisJavaField
.
-
getResolvedType
public JavaClass 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
public JavaAnnotation getDeclaredAnnotation(JavaClass aClass)
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
public java.util.Collection<JavaAnnotation> getDeclaredAnnotations()
Return all of theAnnotations
for thisJavaField
.- Specified by:
getDeclaredAnnotations
in interfaceJavaHasAnnotations
- Returns:
- A
Collection
containing thisJavaField's
JavaAnnotations
.
-
setOwningClass
public void setOwningClass(JavaClass owningClass)
Set theJavaClass
which contains this field.- Parameters:
owningClass
- theJavaClass
representing the owner of thisJavaField
.
-
getOwningClass
public JavaClass getOwningClass()
Returns theJavaClass
which contains this field.- Returns:
JavaClass
representing the owner of thisJavaField
.
-
-