public final class SMGlobalNamespace extends SMNamespace
SMOutputContext
)s
(~= XML documents or sub-trees). This includes the
pre-defined namespaces (ones with "xml" and "xmlns" prefixes as well
as the default "empty"/missing namespace, one bound to "" if no explicit
declaration is made).Modifier and Type | Field and Description |
---|---|
protected String |
_prefix
Prefix this namespace is (permanently) bound to.
|
_uri
Modifier | Constructor and Description |
---|---|
protected |
SMGlobalNamespace(String uri,
String prefix) |
Modifier and Type | Method and Description |
---|---|
protected void |
_bindAs(String prefix)
Global namespaces should never be bound/unbound, so if this
gets called, an exception will be thrown (but note that this
being an 'internal' method, this is more like an assertion).
|
protected void |
_bindPermanentlyAs(String prefix)
Method used to permanently bind this (local) namespace to a prefix.
|
protected void |
_unbind()
Method called to indicate that the namespace is no longer bound
to its current prefix within the current output context.
|
String |
getBoundPrefix() |
String |
getLastBoundPrefix() |
String |
getPreferredPrefix() |
protected boolean |
isValidIn(SMOutputContext ctxt)
Method used to verify that the namespace is actually valid within
the specified output context.
|
boolean |
prefersDefaultNs() |
void |
prefersDefaultNs(boolean state) |
void |
setPreferredPrefix(String prefPrefix)
Method that can be called to associate a "preferred" prefix; prefix
that this namespace should be bound to instead of some automatically
generated one (unless that prefix is already bound to another URI).
|
getURI, isBoundToPrefix
protected final String _prefix
public String getPreferredPrefix()
getPreferredPrefix
in class SMNamespace
public String getBoundPrefix()
getBoundPrefix
in class SMNamespace
public String getLastBoundPrefix()
getLastBoundPrefix
in class SMNamespace
public boolean prefersDefaultNs()
prefersDefaultNs
in class SMNamespace
public void prefersDefaultNs(boolean state)
prefersDefaultNs
in class SMNamespace
public void setPreferredPrefix(String prefPrefix)
SMNamespace
setPreferredPrefix
in class SMNamespace
protected boolean isValidIn(SMOutputContext ctxt)
SMNamespace
isValidIn
in class SMNamespace
protected void _bindAs(String prefix)
_bindAs
in class SMNamespace
protected void _bindPermanentlyAs(String prefix)
SMNamespace
_bindPermanentlyAs
in class SMNamespace
protected void _unbind()
SMNamespace
_unbind
in class SMNamespace
Copyright © 2013 FasterXML. All Rights Reserved.