Package org.codehaus.staxmate.out
Class SMNamespace
- java.lang.Object
-
- org.codehaus.staxmate.out.SMNamespace
-
- Direct Known Subclasses:
SMGlobalNamespace,SMLocalNamespace
public abstract class SMNamespace extends java.lang.ObjectAbstract base class for all namespace objects (local and global ones).
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String_uriURI of the actual namespace this class encapsulates
-
Constructor Summary
Constructors Modifier Constructor Description protectedSMNamespace(java.lang.String uri)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void_bindAs(java.lang.String prefix)Method called to indicate that the namespace is now bound to a specific prefix within current output context.protected abstract void_bindPermanentlyAs(java.lang.String prefix)Method used to permanently bind this (local) namespace to a prefix.protected abstract void_unbind()Method called to indicate that the namespace is no longer bound to its current prefix within the current output context.abstract java.lang.StringgetBoundPrefix()abstract java.lang.StringgetLastBoundPrefix()abstract java.lang.StringgetPreferredPrefix()java.lang.StringgetURI()booleanisBoundToPrefix()protected abstract booleanisValidIn(SMOutputContext ctxt)Method used to verify that the namespace is actually valid within the specified output context.abstract booleanprefersDefaultNs()abstract voidprefersDefaultNs(boolean state)abstract voidsetPreferredPrefix(java.lang.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).
-
-
-
Method Detail
-
getURI
public final java.lang.String getURI()
-
getPreferredPrefix
public abstract java.lang.String getPreferredPrefix()
- Returns:
- Prefix that the caller application has at some point indicated to be a prefix it'd like to see; StaxMate may try to use it as the prefix to bind if there are no
-
getBoundPrefix
public abstract java.lang.String getBoundPrefix()
-
getLastBoundPrefix
public abstract java.lang.String getLastBoundPrefix()
-
prefersDefaultNs
public abstract boolean prefersDefaultNs()
-
isBoundToPrefix
public final boolean isBoundToPrefix()
-
prefersDefaultNs
public abstract void prefersDefaultNs(boolean state)
-
setPreferredPrefix
public abstract void setPreferredPrefix(java.lang.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).
-
isValidIn
protected abstract boolean isValidIn(SMOutputContext ctxt)
Method used to verify that the namespace is actually valid within the specified output context.
-
_bindAs
protected abstract void _bindAs(java.lang.String prefix)
Method called to indicate that the namespace is now bound to a specific prefix within current output context. Note that this will not be called when the namespace is defined as the default namespace, but only when it is also bound to a prefix.
-
_bindPermanentlyAs
protected abstract void _bindPermanentlyAs(java.lang.String prefix)
Method used to permanently bind this (local) namespace to a prefix. Generally called if a new "global" binding is found at point where a global instance can not be created. Calling this method will essentially mark a local instace as behaving similar to a global one.
-
_unbind
protected abstract void _unbind()
Method called to indicate that the namespace is no longer bound to its current prefix within the current output context. Since default namespace declarations do not cause binding, this method will not be called for default namespaces either.
-
-