Package eu.maveniverse.domtrip
Class NamespaceContext
java.lang.Object
eu.maveniverse.domtrip.NamespaceContext
Represents a namespace context for XML elements, providing namespace URI resolution
and prefix management functionality.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty namespace context.NamespaceContext(Map<String, String> prefixToUri, String defaultNamespaceURI) Creates a namespace context with the given prefix-to-URI mappings. -
Method Summary
Modifier and TypeMethodDescriptionGets all declared namespace URIs.Gets all declared prefixes (excluding xml and xmlns).Gets the default namespace URI.booleanisNamespaceUriDeclared(String namespaceURI) Checks if the given namespace URI is declared in this context.booleanisPrefixDeclared(String prefix) Checks if the given prefix is declared in this context.namespaceURI(String prefix) Gets the namespace URI for the given prefix.Gets the first prefix bound to the given namespace URI.Gets all prefixes bound to the given namespace URI.toString()
-
Constructor Details
-
NamespaceContext
public NamespaceContext()Creates an empty namespace context. -
NamespaceContext
Creates a namespace context with the given prefix-to-URI mappings.
-
-
Method Details
-
namespaceURI
Gets the namespace URI for the given prefix. Returns null if the prefix is not bound to any namespace. -
prefix
Gets the first prefix bound to the given namespace URI. Returns null if no prefix is bound to the URI. -
prefixes
Gets all prefixes bound to the given namespace URI. -
defaultNamespaceURI
Gets the default namespace URI. -
isPrefixDeclared
Checks if the given prefix is declared in this context. -
isNamespaceUriDeclared
Checks if the given namespace URI is declared in this context. -
declaredPrefixes
Gets all declared prefixes (excluding xml and xmlns). -
declaredNamespaceURIs
Gets all declared namespace URIs. -
toString
-