|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.staxmate.out.SMOutputtable
org.codehaus.staxmate.out.SMOutputContainer
org.codehaus.staxmate.out.SMOutputElement
public class SMOutputElement
Output class that models an outputtable XML element.
| Field Summary | |
|---|---|
protected java.lang.String |
mLocalName
Local name of the element, name without preceding prefix or colon (in namespace mode). |
protected SMNamespace |
mNs
Namespace of this element. |
protected int |
mOutputState
|
protected SMNamespace |
mParentDefaultNs
Namespace that was bound as the default namespace in the context where this element gets output. |
protected int |
mParentNsCount
Number of explicitly bound namespaces parent element has (or for root elements 0). |
protected static int |
OUTPUT_ATTRS
|
protected static int |
OUTPUT_CHILDREN
|
protected static int |
OUTPUT_CLOSED
|
protected static int |
OUTPUT_NONE
|
| Fields inherited from class org.codehaus.staxmate.out.SMOutputtable |
|---|
mNext |
| Constructor Summary | |
|---|---|
protected |
SMOutputElement(SMOutputContext ctxt,
java.lang.String localName,
SMNamespace ns)
|
| Method Summary | |
|---|---|
void |
addAttribute(SMNamespace ns,
java.lang.String localName,
boolean value)
Typed Access write method to use for adding attribute with boolean value. |
void |
addAttribute(SMNamespace ns,
java.lang.String localName,
int value)
Typed Access write method to use for adding attribute with integer value. |
void |
addAttribute(SMNamespace ns,
java.lang.String localName,
long value)
Typed Access write method to use for adding attribute with long value. |
void |
addAttribute(SMNamespace ns,
java.lang.String localName,
java.lang.String value)
|
void |
addAttribute(java.lang.String localName,
java.lang.String value)
Convenience method for attributes that do not belong to a namespace (no prefix) |
boolean |
canOutputNewChild()
Method called to figure out if we can just output a newly added child, without any buffering. |
protected void |
childReleased(SMOutputtable child)
Method called by a child, when it is released and neither is or contains any buffered entities. |
protected boolean |
doOutput(SMOutputContext ctxt,
boolean canClose)
Method called to request that the entity output itself; either as much as it can without closing, or as much as it can if it is to get closed. |
protected void |
doWriteEndElement()
|
protected void |
doWriteStartElement()
|
protected void |
forceOutput(SMOutputContext ctxt)
Method similar to SMOutputtable.doOutput(org.codehaus.staxmate.out.SMOutputContext, boolean), except that this method will
always succeed in doing the output. |
java.lang.String |
getLocalName()
|
SMNamespace |
getNamespace()
|
void |
getPath(java.lang.StringBuilder sb)
|
void |
linkParent(SMOutputContainer parent,
boolean blocked)
|
protected void |
throwClosedForAttrs()
Method for indicating illegal call to add attributes, when the underlying stream state prevents addition. |
protected SMNamespace |
verifyAttrNS(SMNamespace ns)
Method called to ensure that the passed-in namespace can be used for actual output operation. |
| Methods inherited from class org.codehaus.staxmate.out.SMOutputContainer |
|---|
addAndReleaseBuffered, addBuffered, addCData, addCData, addCharacters, addCharacters, addCharacters, addComment, addElement, addElement, addEntityRef, addProcessingInstruction, addValue, addValue, addValue, closeAllButLastChild, closeAndOutputChildren, createBufferedElement, createBufferedFragment, forceChildOutput, getContext, getNamespace, getNamespace, getParent, getPath, linkNewChild, setIndentation, throwBuffered, throwClosed, throwRelinking |
| Methods inherited from class org.codehaus.staxmate.out.SMOutputtable |
|---|
getNext, linkNext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int OUTPUT_NONE
protected static final int OUTPUT_ATTRS
protected static final int OUTPUT_CHILDREN
protected static final int OUTPUT_CLOSED
protected final java.lang.String mLocalName
protected final SMNamespace mNs
Note: can never be null -- event the default (empty) namespace is presented by a global shared namespace instance.
protected int mOutputState
protected SMNamespace mParentDefaultNs
SMOutputContext that handles actual namespace
binding for output.
This is either the default declared
namespace of an ancestor element, or if none exists, the default
namespace of the root (either the empty namespace, or one found
via NamespaceContext.
Note: can never be null -- event the default (empty) namespace is presented by a global shared namespace instance.
protected int mParentNsCount
SMOutputContext during
time element is open; needed for closing namespace scopes
appropriately.
| Constructor Detail |
|---|
protected SMOutputElement(SMOutputContext ctxt,
java.lang.String localName,
SMNamespace ns)
| Method Detail |
|---|
public java.lang.String getLocalName()
public SMNamespace getNamespace()
public void linkParent(SMOutputContainer parent,
boolean blocked)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public void addAttribute(SMNamespace ns,
java.lang.String localName,
java.lang.String value)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public final void addAttribute(java.lang.String localName,
java.lang.String value)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public void addAttribute(SMNamespace ns,
java.lang.String localName,
boolean value)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public void addAttribute(SMNamespace ns,
java.lang.String localName,
int value)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public void addAttribute(SMNamespace ns,
java.lang.String localName,
long value)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void childReleased(SMOutputtable child)
throws javax.xml.stream.XMLStreamException
SMOutputContainer
childReleased in class SMOutputContainerchild - Child node that now neither is nor contains any buffered
nodes.
javax.xml.stream.XMLStreamException
protected boolean doOutput(SMOutputContext ctxt,
boolean canClose)
throws javax.xml.stream.XMLStreamException
SMOutputtable
doOutput in class SMOutputContainerctxt - Output context to use for outputting this node (and
its contents)canClose - If true, indicates that the node can (and should)
be fully closed if possible. This (passing true) is usually done
when a new sibling
is added after a node (element/fragment); if so, current one
should be recursively closed. If false, should only try to output
as much as can be done without forcing closures.
javax.xml.stream.XMLStreamException
protected void forceOutput(SMOutputContext ctxt)
throws javax.xml.stream.XMLStreamException
SMOutputtableSMOutputtable.doOutput(org.codehaus.staxmate.out.SMOutputContext, boolean), except that this method will
always succeed in doing the output. Specifically, it will force all
buffered nodes to be unbuffered, and then output.
forceOutput in class SMOutputContainerjavax.xml.stream.XMLStreamException
public boolean canOutputNewChild()
throws javax.xml.stream.XMLStreamException
SMOutputContainer
canOutputNewChild in class SMOutputContainerjavax.xml.stream.XMLStreamExceptionpublic void getPath(java.lang.StringBuilder sb)
getPath in class SMOutputContainer
protected void doWriteStartElement()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void doWriteEndElement()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionprotected void throwClosedForAttrs()
protected SMNamespace verifyAttrNS(SMNamespace ns)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||