- All Superinterfaces:
Comparable<IEnhancedQName>
An efficient cache-backed representation of a qualified name.
This implementation uses an underlying integer-based cache to reduce the memory footprint of qualified names and namespaces by reusing instances with the same namespace and local name.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceProvides a callback for resolving namespace prefixes.static interfaceProvides a callback for resolving namespace prefixes. -
Method Summary
Modifier and TypeMethodDescriptionintGet the index position of the qualified name.Get the local part of the qualified name.Get the namespace part of the qualified name.Get the namespace part of the qualified name.static Optional<IEnhancedQName>of(int index) Get an existing qualified name by looking up the cached entry using the provided index value.static IEnhancedQNameGet a qualified name using the provided local name value with no namespace.static IEnhancedQNameGet a qualified name using the provided namespace and local name.static IEnhancedQNameGet a qualified name using the provided namespace and local name.static IEnhancedQNameGet a qualified name using the providedQNamevalue.default StringtoEQName()Generate a qualified name for this QName.default StringtoEQName(StaticContext staticContext) Generate a qualified name for this QName.default StringGenerate a qualified name for this QName, use a prefix provided by the resolver, or by prepending the namespace if no prefix can be resolved.default QNametoQName()Generate aQNamewithout a namespace prefix.default QNameGenerate aQNameusing the provided namespace prefix.Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
getIndexPosition
int getIndexPosition()Get the index position of the qualified name.This value can be used in place of this object. The object can be retrieved using this index with the
of(int)method.- Returns:
- the index position
-
getNamespace
Get the namespace part of the qualified name.- Returns:
- the namespace
-
getNamespaceAsUri
Get the namespace part of the qualified name.- Returns:
- the namespace as a URI
-
getLocalName
Get the local part of the qualified name.- Returns:
- the local name
-
of
Get an existing qualified name by looking up the cached entry using the provided index value.- Parameters:
index- the index value to lookup- Returns:
- an optional containing the qualified name, if it exists
-
of
Get a qualified name using the providedQNamevalue.- Parameters:
qname- the qualified name to get- Returns:
- the qualified name
-
of
Get a qualified name using the provided local name value with no namespace.- Parameters:
localName- the qualified name local part- Returns:
- the qualified name
-
of
Get a qualified name using the provided namespace and local name.- Parameters:
namespace- the qualified name namespace partlocalName- the qualified name local part- Returns:
- the qualified name
-
of
Get a qualified name using the provided namespace and local name.- Parameters:
namespace- the qualified name namespace partlocalName- the qualified name local part- Returns:
- the qualified name
-
toEQName
Generate a qualified name for this QName.This method uses prefixes associated with well-known namespaces, or will prepend the namespace if no prefix can be resolved.
- Returns:
- the extended qualified-name
-
toEQName
Generate a qualified name for this QName, use a prefix provided by the resolver, or by prepending the namespace if no prefix can be resolved.- Parameters:
resolver- the resolver to use to lookup the prefix- Returns:
- the extended qualified-name
-
toEQName
Generate a qualified name for this QName. Use a prefix resolved from the provided static context, or prepend the namespace if no prefix can be resolved.- Parameters:
staticContext- the static context to use to lookup the prefix- Returns:
- the extended qualified-name
-
toQName
Generate aQNamewithout a namespace prefix.- Returns:
- the name
-
toQName
Generate aQNameusing the provided namespace prefix.- Parameters:
prefix- the prefix to use- Returns:
- the name
-