- All Implemented Interfaces:
- Serializable
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
- element's xml tag name
- valuerepresents the element instance's attribute(s) and content model
- element declaration's declaredType(xs:element @typeattribute)
- scopeof element declaration
- boolean nilproperty. (element instance'sxsi:nilattribute)
The declaredType and scope property are the
 Jakarta XML Binding 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.
 
- Author:
- Kohsuke Kawaguchi, Joe Fialli
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classDesignates global scope for an xml element.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionJava datatype binding for xml element declaration's type.protected final QNamexml element tag nameprotected booleantrue iff the xml element instance has xsi:nil="true".protected final Class<?> Scope of xml element declaration representing this xml element instance.protected Txml element value.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturns the Java binding of the xml element declaration's type attribute.getName()Returns the xml element tag name.Class<?> getScope()Returns scope of xml element declaration.getValue()Return the content model and attribute values for this element.booleanReturns true iff this xml element declaration is global.booleanisNil()Returnstrueiff this element instance content model is nil.booleanReturns true iff this xml element instance's value has a different type than xml element declaration's declared type.voidsetNil(boolean value) Set whether this element has nil content.voidSet the content model and attributes of this xml element.
- 
Field Details- 
namexml element tag name
- 
declaredTypeJava datatype binding for xml element declaration's type.
- 
scopeScope of xml element declaration representing this xml element instance. Can be one of the following values: -JAXBElement.GlobalScopefor global xml element declaration. - local element declaration has a scope set to the Java class representation of complex type definition containing xml element declaration.
- 
valuexml element value. Represents content model and attributes of an xml element instance.
- 
nilprotected boolean niltrue iff the xml element instance has xsi:nil="true".
 
- 
- 
Constructor Details- 
JAXBElementConstruct an xml element instance. - Parameters:
- name- Java binding of xml element tag name
- declaredType- Java binding of xml element declaration's type
- scope- Java binding of scope of xml element declaration. Passing null is the same as passing- GlobalScope.class
- value- Java instance representing xml element's value.
- See Also:
 
- 
JAXBElementConstruct an xml element instance.This is just a convenience method for new JAXBElement(name,declaredType,GlobalScope.class,value)
 
- 
- 
Method Details- 
getDeclaredTypeReturns the Java binding of the xml element declaration's type attribute.
- 
getNameReturns the xml element tag name.
- 
setValueSet the content model and attributes of this xml element. When this property is set to null,isNil()must bytrue. Details of constraint are described atisNil().- See Also:
 
- 
getValueReturn the content model and attribute values for this element. See isNil()for a description of a property constraint when this value isnull
- 
getScopeReturns scope of xml element declaration.- Returns:
- GlobalScope.classif this element is of global scope.
- See Also:
 
- 
isNilpublic boolean isNil()Returns trueiff this element instance content model is nil.This property always returns truewhengetValue()is null. Note that the converse is not true, when this property istrue,getValue()can contain a non-null value for attribute(s). It is valid for a nil xml element to have attribute(s).
- 
setNilpublic void setNil(boolean value) Set whether this element has nil content. - See Also:
 
- 
isGlobalScopepublic boolean isGlobalScope()Returns true iff this xml element declaration is global.
- 
isTypeSubstitutedpublic boolean isTypeSubstituted()Returns true iff this xml element instance's value has a different type than xml element declaration's declared type.
 
-