Class JAXBElement<T>

java.lang.Object
jakarta.xml.bind.JAXBElement<T>
All Implemented Interfaces:
Serializable

public class JAXBElement<T> extends Object implements 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
  • value represents the element instance's attribute(s) and content model
  • element declaration's declaredType (xs:element @type attribute)
  • scope of element declaration
  • boolean nil 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 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.

Since:
1.6, JAXB 2.0
See Also: