|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.bind.v2.model.impl.ElementInfoImpl.PropertyImpl
protected class ElementInfoImpl.PropertyImpl
Singleton instance of ElementPropertyInfo
for this element.
Constructor Summary | |
---|---|
protected |
ElementInfoImpl.PropertyImpl()
|
Method Summary | ||
---|---|---|
String |
displayName()
Gets the display name of the property. |
|
Adapter<T,C> |
getAdapter()
|
|
String |
getDefaultValue()
The default value for this element if any. |
|
javax.activation.MimeType |
getExpectedMimeType()
Expected MIME type, if any. |
|
String |
getName()
Gets the name of the property. |
|
QName |
getSchemaType()
The effective value of XmlSchemaType annotation, if any. |
|
PropertyInfo<T,C> |
getSource()
Gets the property which is the source of this reference. |
|
QName |
getTagName()
The associated element name. |
|
NonElement<T,C> |
getTarget()
Target of the reference. |
|
List<? extends TypeRef<T,C>> |
getTypes()
Returns the information about the types allowed in this property. |
|
QName |
getXmlName()
Gets the wrapper element name. |
|
boolean |
hasAnnotation(Class<? extends Annotation> annotationType)
Returns true if the property has the specified annotation. |
|
ID |
id()
Returns the IDness of the value of this element. |
|
boolean |
inlineBinaryData()
If this is true and this property indeed represents a binary data, it should be always inlined. |
|
boolean |
isCollection()
Returns true if this is a multi-valued collection property. |
|
boolean |
isCollectionNillable()
Returns true if this property is nillable (meaning the absence of the value is treated as nil='true') |
|
boolean |
isCollectionRequired()
Checks if the wrapper element is required. |
|
boolean |
isNillable()
Returns true if this element is nillable. |
|
boolean |
isRequired()
Returns true if this element is mandatory. |
|
boolean |
isValueList()
For ElementInfo s, a collection always means a list of values. |
|
PropertyKind |
kind()
Gets the kind of this proeprty. |
|
ElementInfoImpl<T,C,F,M> |
parent()
Gets the ClassInfo or ElementInfo to which this property belongs. |
|
|
readAnnotation(Class<A> annotationType)
Gets the value of the specified annotation from the given property. |
|
List<? extends NonElement<T,C>> |
ref()
List of TypeInfo s that this property references. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ElementInfoImpl.PropertyImpl()
Method Detail |
---|
public NonElement<T,C> getTarget()
NonElementRef
getTarget
in interface NonElementRef<T,C>
public QName getTagName()
TypeRef
getTagName
in interface TypeRef<T,C>
public List<? extends TypeRef<T,C>> getTypes()
ElementPropertyInfo
In a simple case like the following, an element property only has
one TypeRef
that points to String
and tag name "foo".
@XmlElement String abc;
However, in a general case an element property can be heterogeneous, meaning you can put different types in it, each with a different tag name (and a few other settings.)
// list can contain String or Integer. @XmlElements({ @XmlElement(name="a",type=String.class), @XmlElement(name="b",type=Integer.class), }) List<Object> abc;
In this case this method returns a list of two TypeRef
s.
getTypes
in interface ElementPropertyInfo<T,C>
ElementPropertyInfo.isValueList()
==true, there's always exactly one type.public List<? extends NonElement<T,C>> ref()
PropertyInfo
TypeInfo
s that this property references.
This allows the caller to traverse the reference graph without
getting into the details of each different property type.
ref
in interface PropertyInfo<T,C>
public QName getXmlName()
ElementPropertyInfo
getXmlName
in interface ElementPropertyInfo<T,C>
PropertyInfo.isCollection()
==false or
if ElementPropertyInfo.isValueList()
==true.
Otherwise,
this can be null (in which case there'll be no wrapper),
or it can be non-null (in which case there'll be a wrapper)public boolean isCollectionRequired()
ElementPropertyInfo
isCollectionRequired
in interface ElementPropertyInfo<T,C>
ElementPropertyInfo.getXmlName()
==null.public boolean isCollectionNillable()
ElementPropertyInfo
This method is only used when this property is a collection.
isCollectionNillable
in interface ElementPropertyInfo<T,C>
public boolean isNillable()
TypeRef
isNillable
in interface TypeRef<T,C>
public String getDefaultValue()
TypeRef
getDefaultValue
in interface TypeRef<T,C>
public ElementInfoImpl<T,C,F,M> parent()
PropertyInfo
ClassInfo
or ElementInfo
to which this property belongs.
parent
in interface PropertyInfo<T,C>
public String getName()
PropertyInfo
For example, "foo" or "bar". Generally, a property name is different from XML, (although they are often related, as a property name is often computed from tag names / attribute names.) In fact, property names do not directly affect XML. The property name uniquely identifies a property within a class.
getName
in interface PropertyInfo<T,C>
XmlType.propOrder()
public String displayName()
PropertyInfo
This is a convenience method for
parent().getName()+'#'+getName()
.
displayName
in interface PropertyInfo<T,C>
public boolean isCollection()
PropertyInfo
isCollection
in interface PropertyInfo<T,C>
public boolean isValueList()
ElementInfo
s, a collection always means a list of values.
isValueList
in interface ElementPropertyInfo<T,C>
public boolean isRequired()
ElementPropertyInfo
isRequired
in interface ElementPropertyInfo<T,C>
public PropertyKind kind()
PropertyInfo
kind
in interface PropertyInfo<T,C>
public Adapter<T,C> getAdapter()
getAdapter
in interface ElementPropertyInfo<T,C>
getAdapter
in interface PropertyInfo<T,C>
public ID id()
PropertyInfo
id
in interface PropertyInfo<T,C>
XmlID
,
XmlIDREF
public javax.activation.MimeType getExpectedMimeType()
PropertyInfo
getExpectedMimeType
in interface PropertyInfo<T,C>
public QName getSchemaType()
PropertyInfo
XmlSchemaType
annotation, if any.
If the property doesn't have XmlSchemaType
annotation,
this method returns null.
Since a type name is a property of a Java type, not a Java property,
A schema type name of a Java type should be primarily obtained
by using NonElement.getTypeName()
. This method is to correctly
implement the ugly semantics of XmlSchemaType
(namely
when this returns non-null, it overrides the type names of all types
that are in this property.)
getSchemaType
in interface PropertyInfo<T,C>
public boolean inlineBinaryData()
PropertyInfo
inlineBinaryData
in interface PropertyInfo<T,C>
public PropertyInfo<T,C> getSource()
NonElementRef
getSource
in interface NonElementRef<T,C>
public <A extends Annotation> A readAnnotation(Class<A> annotationType)
AnnotationSource
When this method is used for a property that consists of a getter and setter, it returns the annotation on either of those methods. If both methods have the same annotation, it is an error.
readAnnotation
in interface AnnotationSource
public boolean hasAnnotation(Class<? extends Annotation> annotationType)
AnnotationSource
Short for readAnnotation(annotationType)!=null
,
but this method is typically faster.
hasAnnotation
in interface AnnotationSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |