|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.xml.bind.JAXBElement<T>
public class JAXBElement<T>
JAXB 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
The declaredType and scope property are the JAXB class binding for the xml type definition.
Scope is either JAXBElement.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.
Nested Class Summary | |
---|---|
static class |
JAXBElement.GlobalScope
Designates global scope for an xml element. |
Field Summary | |
---|---|
protected java.lang.Class<T> |
declaredType
Java datatype binding for xml element declaration's type. |
protected javax.xml.namespace.QName |
name
xml element tag name |
protected boolean |
nil
true iff the xml element instance has xsi:nil="true". |
protected java.lang.Class |
scope
Scope of xml element declaration representing this xml element instance. |
protected T |
value
xml element value. |
Constructor Summary | |
---|---|
JAXBElement(javax.xml.namespace.QName name,
java.lang.Class<T> declaredType,
java.lang.Class scope,
T value)
Construct an xml element instance. |
|
JAXBElement(javax.xml.namespace.QName name,
java.lang.Class<T> declaredType,
T value)
Construct an xml element instance. |
Method Summary | |
---|---|
java.lang.Class<T> |
getDeclaredType()
Returns the Java binding of the xml element declaration's type attribute. |
javax.xml.namespace.QName |
getName()
Returns the xml element tag name. |
java.lang.Class |
getScope()
Returns scope of xml element declaration. |
T |
getValue()
Return the content model and attribute values for this element. |
boolean |
isGlobalScope()
Returns true iff this xml element declaration is global. |
boolean |
isNil()
Returns true iff this element instance content model is nil. |
boolean |
isTypeSubstituted()
Returns true iff this xml element instance's value has a different type than xml element declaration's declared type. |
void |
setNil(boolean value)
Set whether this element has nil content. |
void |
setValue(T t)
Set the content model and attributes of this xml element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final javax.xml.namespace.QName name
protected final java.lang.Class<T> declaredType
protected final java.lang.Class scope
JAXBElement.GlobalScope
for global xml element declaration.
- local element declaration has a scope set to the Java class
representation of complex type defintion containing
xml element declaration.
protected T value
protected boolean nil
Constructor Detail |
---|
public JAXBElement(javax.xml.namespace.QName name, java.lang.Class<T> declaredType, java.lang.Class scope, T value)
Construct an xml element instance.
name
- Java binding of xml element tag namedeclaredType
- Java binding of xml element declaration's typescope
- Java binding of scope of xml element declaration.
Passing null is the same as passing GlobalScope.classvalue
- Java instance representing xml element's value.getScope()
,
isTypeSubstituted()
public JAXBElement(javax.xml.namespace.QName name, java.lang.Class<T> declaredType, T value)
Method Detail |
---|
public java.lang.Class<T> getDeclaredType()
public javax.xml.namespace.QName getName()
public void setValue(T t)
Set the content model and attributes of this xml element.
When this property is set to null, isNil() must by true.
Details of constraint are described at isNil()
.
isTypeSubstituted()
public T getValue()
Return the content model and attribute values for this element.
See isNil()
for a description of a property constraint when
this value is null
public java.lang.Class getScope()
isGlobalScope()
public boolean isNil()
Returns true iff this element instance content model is nil.
This property always returns true when getValue()
is null.
Note that the converse is not true, when this property is true,
getValue()
can contain a non-null value for attribute(s). It is
valid for a nil xml element to have attribute(s).
public void setNil(boolean value)
Set whether this element has nil content.
isNil()
public boolean isGlobalScope()
public boolean isTypeSubstituted()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.
Generated on 10-February-2011 12:41