Package org.jsoup.internal
Class NamespaceBindings
java.lang.Object
org.jsoup.internal.NamespaceBindings
public final class NamespaceBindings
extends Object
Tracks namespace prefix bindings across nested element scopes. Jsoup internal; API subject to change.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyDeclarations(Attributes attributes) Applies namespace declarations from an attribute set.voidclear()Clears all bindings and scopes for reuse.static @Nullable StringdeclarationPrefix(String key) Returns the prefix declared by anxmlnskey, or null if it is not a declaration.@Nullable Stringget(String prefix) Returns the namespace URI bound to a prefix, or null if unbound.static booleanisDeclaration(String key) Tests whether a key is anxmlnsdeclaration.voidpopScope()Closes the current scope and restores its parent bindings.voidOpens a namespace scope.voidput(String prefix, String namespace) Binds a prefix in the current scope, or at the root if no scope is open.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Method Details
-
clear
public void clear()Clears all bindings and scopes for reuse. -
pushScope
public void pushScope()Opens a namespace scope. -
popScope
public void popScope()Closes the current scope and restores its parent bindings. -
put
public void put(String prefix, String namespace) Binds a prefix in the current scope, or at the root if no scope is open. -
get
public @Nullable String get(String prefix) Returns the namespace URI bound to a prefix, or null if unbound. -
applyDeclarations
Applies namespace declarations from an attribute set. -
isDeclaration
public static boolean isDeclaration(String key) Tests whether a key is anxmlnsdeclaration. -
declarationPrefix
public static @Nullable String declarationPrefix(String key) Returns the prefix declared by anxmlnskey, or null if it is not a declaration.
-