Jakarta XML Binding representation of an Xml Element.
This class represents information about an Xml Element from both the element declaration within a schema and the element instance value within an xml document with the following properties
namevalue represents the element instance's attribute(s) and content modeldeclaredType (xs:element @type attribute)scope of element declarationnil property. (element instance's xsi:nil attribute)The declaredType and scope property are the
Jakarta XML Binding class binding for the xml type definition.
Scope is either GlobalScope or the Java class representing the
complex type definition containing the schema element declaration.
There is a property constraint that if value is null,
then nil must be true. The converse is not true to enable
representing a nil element with attribute(s). If nil is true, it is possible
that value is non-null so it can hold the value of the attributes
associated with a nil element.
| Modifier and Type | Class and Description |
|---|---|
| public static class | JAXBElement.GlobalScope
Designates global scope for an xml element. |
| Modifier and Type | Field and Description |
|---|---|
| protected final Class | declaredType
Java datatype binding for xml element declaration's type. |
| protected final QName | name
xml element tag name |
| protected boolean | nil
true iff the xml element instance has xsi:nil="true". |
| protected final Class | scope
Scope of xml element declaration representing this xml element instance. |
| private static final long | |
| protected T | value
xml element value. |
| Access | Constructor and Description |
|---|---|
| public | JAXBElement(QName
Java binding of xml element tag name name, Class<T> Java binding of xml element declaration's type declaredType, Class<?> Java binding of scope of xml element declaration.
Passing null is the same as passing scope, T GlobalScope.classJava instance representing xml element's value. value)Construct an xml element instance. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Class | |
| public QName | |
| public Class | Returns: GlobalScope.class if this element is of global scope.Returns scope of xml element declaration. |
| public T | |
| public boolean | |
| public boolean | |
| public boolean | isTypeSubstituted()
Returns true iff this xml element instance's value has a different type than xml element declaration's declared type. |
| public void | |
| public void |
| declaredType | back to summary |
|---|---|
| protected final Class<T> declaredType Java datatype binding for xml element declaration's type. | |
| name | back to summary |
|---|---|
| protected final QName name xml element tag name | |
| nil | back to summary |
|---|---|
| protected boolean nil true iff the xml element instance has xsi:nil="true". | |
| scope | back to summary |
|---|---|
| protected final Class<?> scope Scope of xml element declaration representing this xml element instance.
Can be one of the following values:
- | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| value | back to summary |
|---|---|
| protected T value xml element value. Represents content model and attributes of an xml element instance. | |
| JAXBElement | back to summary |
|---|---|
| public JAXBElement(QName name, Class<T> declaredType, Class<?> scope, T value) Construct an xml element instance.
| |
| JAXBElement | back to summary |
|---|---|
| public JAXBElement(QName name, Class<T> declaredType, T value) Construct an xml element instance.
This is just a convenience method for | |
| getDeclaredType | back to summary |
|---|---|
| public Class Returns the Java binding of the xml element declaration's type attribute. | |
| getName | back to summary |
|---|---|
| public QName getName() Returns the xml element tag name. | |
| getScope | back to summary |
|---|---|
| public Class Returns scope of xml element declaration.
| |
| getValue | back to summary |
|---|---|
| public T getValue() Return the content model and attribute values for this element. See | |
| isGlobalScope | back to summary |
|---|---|
| public boolean isGlobalScope() Returns true iff this xml element declaration is global. | |
| isNil | back to summary |
|---|---|
| public boolean isNil() Returns This property always returns | |
| isTypeSubstituted | back to summary |
|---|---|
| public boolean isTypeSubstituted() Returns true iff this xml element instance's value has a different type than xml element declaration's declared type. | |
| setNil | back to summary |
|---|---|
| public void setNil(boolean value) Set whether this element has nil content.
| |
| setValue | back to summary |
|---|---|
| public void setValue(T t) Set the content model and attributes of this xml element. When this property is set to
| |
| Access | Constructor and Description |
|---|---|
| private |
| GlobalScope | back to summary |
|---|---|
| private GlobalScope() | |