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, isBoundToPrefixprotected final String _prefix
public String getPreferredPrefix()
getPreferredPrefix in class SMNamespacepublic String getBoundPrefix()
getBoundPrefix in class SMNamespacepublic String getLastBoundPrefix()
getLastBoundPrefix in class SMNamespacepublic boolean prefersDefaultNs()
prefersDefaultNs in class SMNamespacepublic void prefersDefaultNs(boolean state)
prefersDefaultNs in class SMNamespacepublic void setPreferredPrefix(String prefPrefix)
SMNamespacesetPreferredPrefix in class SMNamespaceprotected boolean isValidIn(SMOutputContext ctxt)
SMNamespaceisValidIn in class SMNamespaceprotected void _bindAs(String prefix)
_bindAs in class SMNamespaceprotected void _bindPermanentlyAs(String prefix)
SMNamespace_bindPermanentlyAs in class SMNamespaceprotected void _unbind()
SMNamespace_unbind in class SMNamespaceCopyright © 2021 FasterXML. All rights reserved.