|
Element
|
adapt(Element source, ElementMetadata<?, ?> sourceMeta, String kind)
Adapts an element based on a key.
|
|
<T extends Element>
T
|
adapt(ElementKey<?, T> key, Element source)
Adapts an element based on a different key.
|
|
Element
|
addElement(QName id, Element element)
Add a child element with the given ID.
|
|
Element
|
addElement(ElementKey<?, ?> key, Element element)
Add a child element with the given key.
|
|
Element
|
addElement(Element element)
Add a child element, using the key of the child element as the key into
this element's children.
|
|
void
|
clear()
Clears internal state of all attributes, child elements, and text content.
|
|
static
<E extends Element>
E
|
createElement(ElementKey<?, E> key, Element source)
Helper method that constructs a new Element instance of the type
defined by the type parameter E.
|
|
static
<E extends Element>
E
|
createElement(ElementKey<?, E> key)
Helper method that constructs a new Element instance of the type
defined by the type parameter E.
|
|
static
boolean
|
eq(Object o1, Object o2)
Helper method to check for equality between two object, including null
checks.
|
|
boolean
|
equals(Object obj)
|
|
int
|
getAttributeCount()
Returns the number of attributes present on this element.
|
|
Iterator<Attribute>
|
getAttributeIterator(ElementMetadata<?, ?> metadata)
Returns an iterator over the attributes of this element with a well-defined
iteration order based on the metadata.
|
|
Iterator<Attribute>
|
getAttributeIterator()
Returns an iterator over all attributes on this element.
|
|
Object
|
getAttributeValue(QName id)
Get the value of an attribute by id.
|
|
<T>
T
|
getAttributeValue(AttributeKey<T> key)
Returns the attribute value cast to the appropriate type, based on the
given key.
|
|
static
ElementKey<?, ?>
|
getDefaultKey(Class<? extends Element> type)
|
|
<D, T extends Element>
T
|
getElement(ElementKey<D, T> childKey)
Get child element matching the specified key.
|
|
Element
|
getElement(QName id)
Get a child element matching the specified qualified name.
|
|
int
|
getElementCount()
Returns the number of child elements present on this element.
|
|
QName
|
getElementId()
Get the id of this element.
|
|
Iterator<Element>
|
getElementIterator()
Returns an iterator over all child elements of this element.
|
|
Iterator<Element>
|
getElementIterator(ElementMetadata<?, ?> metadata)
Returns an iterator over all child elements with a well-defined iteration
order based on this metadata.
|
|
ElementKey<?, ?>
|
getElementKey()
Returns the key to this element.
|
|
<T extends Element>
Set<T>
|
getElementSet(ElementKey<?, T> key)
Get child elements matching the specified key.
|
|
Set<Element>
|
getElementSet(QName id)
Get child elements matching the specified id.
|
|
<V>
V
|
getElementValue(ElementKey<V, ? extends Element> key)
Convenience method to return child element's text node cast to
the specified type.
|
|
Object
|
getElementValue(QName id)
Convenience method to return child element's text node as an object.
|
|
List<Element>
|
getElements(QName id)
Returns an immutable list of elements matching the given id.
|
|
<T extends Element>
List<T>
|
getElements(ElementKey<?, T> key)
Get child elements matching the specified key.
|
|
<V>
V
|
getTextValue(ElementKey<V, ?> key)
Returns the element value adapted to the key's datatype.
|
|
Object
|
getTextValue()
Returns the untyped element value or null if it has no value.
|
|
boolean
|
hasAttribute(AttributeKey<?> childKey)
Returns true if the element has an attribute with the given key.
|
|
boolean
|
hasAttribute(QName id)
Returns true if the element has an attribute with the given id.
|
|
boolean
|
hasElement(QName id)
Returns true if the element has child element(s) with the given id.
|
|
boolean
|
hasElement(ElementKey<?, ?> childKey)
Returns true if the element has child element(s) with the given key.
|
|
boolean
|
hasTextValue()
|
|
int
|
hashCode()
|
|
final
boolean
|
isLocked()
Returns true if this element has been locked using lock().
|
|
Element
|
lock()
Locks this element.
|
|
Element
|
narrow(ElementMetadata<?, ?> metadata, ValidationContext vc)
Narrow down element's type to the most specific one possible.
|
|
Object
|
removeAttribute(AttributeKey<?> key)
This method is deprecated.
use removeAttributeValue instead.
|
|
Object
|
removeAttribute(QName id)
This method is deprecated.
use removeAttributeValue instead.
|
|
Object
|
removeAttributeValue(AttributeKey<?> key)
Remove attribute (if present).
|
|
Object
|
removeAttributeValue(QName id)
Remove attribute (if present).
|
|
boolean
|
removeElement(Element element)
Remove a single child element from this element.
|
|
Element
|
removeElement(QName id)
Remove child element(s) of a given name.
|
|
Element
|
removeElement(ElementKey<?, ?> childKey)
Remove child element(s) of a given name.
|
|
boolean
|
removeElement(ElementKey<?, ?> childKey, Element element)
Remove a single child element from this element.
|
|
boolean
|
replaceElement(Element toRemove, Element toAdd)
Replace one element with another.
|
|
Element
|
resolve(ElementMetadata<?, ?> metadata, ValidationContext vc)
Resolve this element's state against the metadata.
|
|
Element
|
resolve(ElementMetadata<?, ?> metadata)
Resolve the state of all elements in the tree, rooted at this
element, against the metadata.
|
|
boolean
|
sameClassAs(Object o)
|
|
Element
|
setAttributeValue(AttributeKey<?> key, Object attrValue)
Add attribute by value.
|
|
Element
|
setAttributeValue(QName id, Object attrValue)
Add attribute by id and value.
|
|
Element
|
setElement(Element element)
Sets a child element to the given value.
|
|
Element
|
setElement(QName id, Element element)
Sets the value of the child element(s) with the given id.
|
|
Element
|
setElement(ElementKey<?, ?> key, Element element)
Sets the value of the child element(s) with the key.
|
|
Element
|
setTextValue(Object newValue)
Sets the value of the element and returns the element to allow chaining.
|
|
String
|
toString()
|
|
void
|
validate(ElementMetadata<?, ?> metadata, ValidationContext vc)
Validate the element using the given metadata, and placing any errors into
the validation context.
|
|
void
|
visit(ElementVisitor ev, ElementMetadata<?, ?> meta)
|