|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.staxmate.out.SMNamespace
org.codehaus.staxmate.out.SMLocalNamespace
public final class SMLocalNamespace
Namespace that is local to a specific output context
(SMOutputContext), think of it as the document or sub-tree
StaxMate will output using a stream writer).
| Field Summary | |
|---|---|
protected SMOutputContext |
mContext
Output context in which this namespace is to be used (scope of which it is bound) |
protected java.lang.String |
mCurrPrefix
Prefix this namespace is currently bound to, if any. |
protected boolean |
mIsPermanent
|
protected boolean |
mPreferDefaultNs
Flag that indicates whether this namespaces prefers to be bound as the default namespace (for elements), or not. |
protected java.lang.String |
mPrefPrefix
Prefererred (or suggested) prefix for the namespace; StaxMate will try to use this prefix if possible when binding namespaces and also passes it to the underlying stream writer. |
protected java.lang.String |
mPrevPrefix
Last prefix this name was bound to, if any. |
| Fields inherited from class org.codehaus.staxmate.out.SMNamespace |
|---|
mURI |
| Constructor Summary | |
|---|---|
protected |
SMLocalNamespace(SMOutputContext ctxt,
java.lang.String uri,
boolean preferDefaultNs,
java.lang.String prefPrefix)
|
| Method Summary | |
|---|---|
protected void |
bindAs(java.lang.String prefix)
The only trick with regard to binding/unbinding of local namespaces is that "re-binding" is not allowed (by StaxMate design; XML would allow it). |
protected void |
bindPermanentlyAs(java.lang.String prefix)
Method used to permanently bind this (local) namespace to a prefix. |
java.lang.String |
getBoundPrefix()
|
java.lang.String |
getLastBoundPrefix()
|
java.lang.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(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). |
protected void |
unbind()
Method called to indicate that the namespace is no longer bound to its current prefix within the current output context. |
| Methods inherited from class org.codehaus.staxmate.out.SMNamespace |
|---|
getURI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final SMOutputContext mContext
protected java.lang.String mPrefPrefix
This value will be automatically set when namespace is created, and there is also a way to explicitly set it. Finally, it will also be set if a dynamic prefix is created for the namespace
protected java.lang.String mCurrPrefix
protected java.lang.String mPrevPrefix
protected boolean mPreferDefaultNs
protected boolean mIsPermanent
| Constructor Detail |
|---|
protected SMLocalNamespace(SMOutputContext ctxt,
java.lang.String uri,
boolean preferDefaultNs,
java.lang.String prefPrefix)
ctxt - Output context that "owns" this namespace (within which
namespace will be bound when output)uri - URI that defines identity of the namespaceprefPrefix - Prefererred (or suggested) prefix for the namespace;
StaxMate will try to use this prefix if possible when binding
namespaces and also passes it to the underlying stream writer.preferDefaultNs - Whether this namespaces prefers to be bound
as the default namespace when used for elements.| Method Detail |
|---|
public java.lang.String getPreferredPrefix()
getPreferredPrefix in class SMNamespacepublic java.lang.String getBoundPrefix()
getBoundPrefix in class SMNamespacepublic java.lang.String getLastBoundPrefix()
getLastBoundPrefix in class SMNamespacepublic boolean prefersDefaultNs()
prefersDefaultNs in class SMNamespacepublic void prefersDefaultNs(boolean state)
prefersDefaultNs in class SMNamespacepublic void setPreferredPrefix(java.lang.String prefPrefix)
SMNamespace
setPreferredPrefix in class SMNamespaceprotected boolean isValidIn(SMOutputContext ctxt)
SMNamespace
isValidIn in class SMNamespaceprotected void bindAs(java.lang.String prefix)
bindAs in class SMNamespaceprotected void bindPermanentlyAs(java.lang.String prefix)
SMNamespace
bindPermanentlyAs in class SMNamespaceprotected void unbind()
SMNamespace
unbind in class SMNamespace
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||