- All Implemented Interfaces:
Base class for all PushMode DOM nodes that can be children of an element. This includes
DomText. DOM nodes can be mutable (
DomFragment) or immutable (
DomText). Mutable nodes can be frozen, which causes all mutating methods to throw. All in all, DOM nodes can be in three states: immutable, mutable, and frozen. Immutable state cannot be changed. Transition from mutable to frozen state is performed by
freeze(). Transition from frozen to mutable state is performed by
clone(). All classes inheriting from
hashCode(). HTML representation of the node can be obtained from
- Immutable and frozen nodes are thread-safe. Mutable nodes can be only used by single thread at a time.
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description
clone()Creates mutable deep clone of this node.
equals(Object obj)Compares this node with another DOM node for equality.
freeze()Creates frozen deep clone of this node.
hashCode()Computes deep hash code of the node.
toString()Serialized HTML code for this node.
public abstract DomContent clone()Creates mutable deep clone of this node. If this node is immutable, this method just returns
this. For frozen and mutable nodes, this method returns mutable deep clone that is completely independent of this node.
- Deep mutable clone. Returns
thisfor immutable nodes.
- This method can be executed concurrently with other read-only operations on the same node. If this node is modified while being cloned, some descendants in the clone might be missing or duplicated, but this method will never throw, this node is never damaged, and the cloned node will be always internally consistent.
public abstract DomContent freeze()Creates frozen deep clone of this node. Mutating methods throw when executed on frozen node. Frozen nodes can be safely shared by all threads. Freezing is recursive. Frozen nodes therefore cannot contain mutable nodes. If this node is immutable (i.e.
DomText) or already frozen, this method just returns
this. Freezing applies several transformations to the node, so that these transformations don't have to be performed repeatedly during rendering. While
DomFragmentitself can be frozen, frozen DOM nodes cannot contain any
DomFragmentdescendant. For this reason, the returned frozen node has all
DomFragmentdescendants inlined into their respective parents. Freezing a node causes all consecutive text nodes to be concatenated into single node. Empty text nodes are removed. Listeners attached to descendants of type
DomElementare discarded if the element has null
DomElement.id(). All internal arrays are compacted, so that the frozen DOM tree takes up minimum amount of memory. None of these transformations modifies the original node in any way.
- Deep frozen clone. Returns
thisfor frozen and immutable nodes.
public boolean equals(Object obj)Compares this node with another DOM node for equality.
public int hashCode()Computes deep hash code of the node.