public class ElementDeclaration
extends java.lang.Object
An ElementDeclaration object is used to represent the information that is associated with a global element in XML.
ElementDeclarations will be created for classes with an XMLRootElement annotation, for TypeMappingInfo objects which have an xml tag name specified.
Constructor and Description |
---|
ElementDeclaration(javax.xml.namespace.QName name,
JavaClass javaType,
java.lang.String javaTypeName,
boolean isList)
Create a new ElementDeclaration.
|
ElementDeclaration(javax.xml.namespace.QName name,
JavaClass javaType,
java.lang.String javaTypeName,
boolean isList,
java.lang.Class scopeClass)
Create a new ElementDeclaration and set the scope.
|
Modifier and Type | Method and Description |
---|---|
void |
addSubstitutableElement(ElementDeclaration element)
Add an element to the list of elements which can be substituted for this element (ie: has this element in their substitutionGroup)
|
JavaClass |
getAdaptedJavaType()
Get the adapted java type.
|
java.lang.String |
getAdaptedJavaTypeName()
Get the adapted java type name.
|
java.lang.String |
getDefaultValue()
This will be set if XmlElementDecl has a defaultValue specified
|
javax.xml.namespace.QName |
getElementName()
Get the QName representing this element
|
JavaClass |
getJavaType()
The javaType associated with this element.
|
java.lang.Class |
getJavaTypeAdapterClass()
Get the java type adapter class associated with the element
|
java.lang.String |
getJavaTypeName()
Get the name of the java type associated with this global element.
|
java.lang.Class |
getScopeClass()
Get the scope class associated with this element.
|
java.util.List<ElementDeclaration> |
getSubstitutableElements()
The list of elements which can be substituted for this element (ie: has this element in their substitutionGroup)
|
javax.xml.namespace.QName |
getSubstitutionHead()
If this element has a substitutionGroup this will be set.
|
TypeMappingInfo |
getTypeMappingInfo()
Get the TypeMappingInfo object if this ElementDeclaration was created from a TypeMappingInfo
|
java.lang.String |
getXmlMimeType()
Return the mimeType specified on this element.
|
boolean |
isList()
Return if this element is a list
|
boolean |
isNillable()
Return if the global element will be marked as nillable
|
boolean |
isXmlAttachmentRef()
Return if this element is associated with an XmlAttachmentRef annotation
|
boolean |
isXmlRootElement()
Track if this element had an @XmlRootElement annotation
|
void |
setAdaptedJavaType(JavaClass adaptedJavaType)
Set the adapted java type if there is an XmlJavaTypeAdapter associated with this element
This will also set the adaptedJavaTypeName (getAdaptedJavaTypeName)
|
void |
setDefaultValue(java.lang.String value)
Set the default value associated with this element.
|
void |
setIsXmlRootElement(boolean isXmlRoot)
Mark if this element had an @XmlRootElement annotation
|
void |
setJavaType(JavaClass type)
Set the javaType associated with this element.
|
void |
setJavaTypeAdapterClass(java.lang.Class javaTypeAdapterClass)
Set the java type adapter class associated with this element if applicable.
|
void |
setList(boolean isList)
Mark if this element is a list
|
void |
setNillable(boolean nillable)
Set if the global element should be marked as nillable
|
void |
setScopeClass(java.lang.Class scopeClass)
Set the scope class associated with this element.
|
void |
setSubstitutionHead(javax.xml.namespace.QName rootElement)
If this element has a substitutionGroup this will be set.
|
void |
setTypeMappingInfo(TypeMappingInfo info)
Set the TypeMappingInfo object if this ElementDeclaration was created from a TypeMappingInfo
|
void |
setXmlAttachmentRef(boolean xmlAttachmentRef)
Set if there is an XmlAttachmentRef annotations associated with this element.
|
void |
setXmlMimeType(java.lang.String xmlMimeType)
Set of this element has an XmlMimeType annotation
|
public ElementDeclaration(javax.xml.namespace.QName name, JavaClass javaType, java.lang.String javaTypeName, boolean isList)
name
- The QName of this elementjavaType
- The JavaClass of this elementjavaTypeName
- The String name of the javaTypeisList
- A boolean representing if this corresponds to an xsd:listpublic ElementDeclaration(javax.xml.namespace.QName name, JavaClass javaType, java.lang.String javaTypeName, boolean isList, java.lang.Class scopeClass)
name
- The QName of this elementjavaType
- The JavaClass of this elementjavaTypeName
- The String name of the javaTypeisList
- A boolean representing if this corresponds to an xsd:listscopeClass
- The class representing the scope of this elementpublic javax.xml.namespace.QName getElementName()
public java.lang.String getJavaTypeName()
public java.util.List<ElementDeclaration> getSubstitutableElements()
public void addSubstitutableElement(ElementDeclaration element)
public void setSubstitutionHead(javax.xml.namespace.QName rootElement)
rootElement
- the QName value of the substitutionGrouppublic javax.xml.namespace.QName getSubstitutionHead()
public boolean isXmlRootElement()
public void setIsXmlRootElement(boolean isXmlRoot)
isXmlRoot
- if the element has an @XmlRootElementpublic boolean isNillable()
public void setNillable(boolean nillable)
nillable
- public JavaClass getJavaType()
public void setJavaType(JavaClass type)
type
- the javaType associated with this element.public boolean isList()
public void setList(boolean isList)
isList
- true if the element is a listpublic java.lang.Class getJavaTypeAdapterClass()
public void setJavaTypeAdapterClass(java.lang.Class javaTypeAdapterClass)
javaTypeAdapterClass
- Class of the java type adapter associated with this element.public JavaClass getAdaptedJavaType()
public void setAdaptedJavaType(JavaClass adaptedJavaType)
adaptedJavaType
- set the JavaClass representing the adapted Java typepublic java.lang.String getAdaptedJavaTypeName()
public java.lang.Class getScopeClass()
public void setScopeClass(java.lang.Class scopeClass)
scopeClass
- associated with this element.public java.lang.String getDefaultValue()
public void setDefaultValue(java.lang.String value)
value
- the default value that corresponds to this element.public TypeMappingInfo getTypeMappingInfo()
public void setTypeMappingInfo(TypeMappingInfo info)
info
- The TypeMappingInfo object used to create this ElementDeclarationpublic java.lang.String getXmlMimeType()
public void setXmlMimeType(java.lang.String xmlMimeType)
xmlMimeType
- set the name of the mime type if specified for this elementpublic boolean isXmlAttachmentRef()
public void setXmlAttachmentRef(boolean xmlAttachmentRef)
xmlAttachmentRef
- true if there is an XmlAttachmentRef annotation