public final class NodeBuilder extends Object
Small fast utility for efficient construction of elements and attributes. Implemented via a LRU cache of the most recent elements and attributes.
Avoids repeated XML reverification in XOM Element and Attribute constructor on cache hit, plus avoids generating new String objects by quasi "interning" localName and prefix, which in turn reduces memory consumption. Has overhead close to zero on cache miss.
This implementation is not thread-safe.
This class would become obsolete if the XOM Element and Attribute classes would have an internal LRU cache of QNames.
|Constructor and Description|
Constructs a new instance.
|Modifier and Type||Method and Description|
Contructs and returns a new attribute for the given qualified name and namespace URI.
Contructs and returns a new element for the given qualified name and namespace URI.
qname- the qualified name of the element (must not be null)
uri- the namespace URI of the element
public nu.xom.Attribute createAttribute(String qname, String uri, String value, nu.xom.Attribute.Type type)
qname- the qualified name of the attribute (must not be null)
uri- the namespace URI of the attribute
value- the attribute value (must not be null)
type- the attribute type (must not be null)
Copyright © 2019. All rights reserved.