|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.internet2.middleware.grouperClientExt.com.thoughtworks.xstream.io.WriterWrapper
edu.internet2.middleware.grouperClientExt.com.thoughtworks.xstream.io.StatefulWriter
public class StatefulWriter
An wrapper for all HierarchicalStreamWriter implementations, that keeps the state.
Writing in a wrong state will throw a StreamException, that wraps either an
IOException (writing to a closed writer) or an IllegalStateException. The
implementation will also track unbalanced nodes or multiple attributes with the same name.
| Field Summary | |
|---|---|
static int |
STATE_CLOSED
STATE_CLOSED is the state if the writer has been closed. |
static int |
STATE_NODE_END
STATE_NODE_END is the state if a node has ended |
static int |
STATE_NODE_START
STATE_NODE_START is the state of a new node has been started. |
static int |
STATE_OPEN
STATE_OPEN is the initial value of the writer. |
static int |
STATE_VALUE
STATE_VALUE is the state if the value of a node has been written. |
| Fields inherited from class edu.internet2.middleware.grouperClientExt.com.thoughtworks.xstream.io.WriterWrapper |
|---|
wrapped |
| Constructor Summary | |
|---|---|
StatefulWriter(HierarchicalStreamWriter wrapped)
Constructs a StatefulWriter. |
|
| Method Summary | |
|---|---|
void |
addAttribute(String name,
String value)
|
void |
close()
Close the writer, if necessary. |
void |
endNode()
|
void |
flush()
Flush the writer, if necessary. |
void |
setValue(String text)
Write the value (text content) of the current node. |
void |
startNode(String name)
|
void |
startNode(String name,
Class clazz)
|
int |
state()
Retrieve the state of the writer. |
| Methods inherited from class edu.internet2.middleware.grouperClientExt.com.thoughtworks.xstream.io.WriterWrapper |
|---|
underlyingWriter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int STATE_OPEN
STATE_OPEN is the initial value of the writer.
public static int STATE_NODE_START
STATE_NODE_START is the state of a new node has been started.
public static int STATE_VALUE
STATE_VALUE is the state if the value of a node has been written.
public static int STATE_NODE_END
STATE_NODE_END is the state if a node has ended
public static int STATE_CLOSED
STATE_CLOSED is the state if the writer has been closed.
| Constructor Detail |
|---|
public StatefulWriter(HierarchicalStreamWriter wrapped)
wrapped - the wrapped writer| Method Detail |
|---|
public void startNode(String name)
startNode in interface HierarchicalStreamWriterstartNode in class WriterWrapper
public void startNode(String name,
Class clazz)
startNode in interface ExtendedHierarchicalStreamWriterstartNode in class WriterWrapper
public void addAttribute(String name,
String value)
addAttribute in interface HierarchicalStreamWriteraddAttribute in class WriterWrapperpublic void setValue(String text)
HierarchicalStreamWriter
setValue in interface HierarchicalStreamWritersetValue in class WriterWrapperpublic void endNode()
endNode in interface HierarchicalStreamWriterendNode in class WriterWrapperpublic void flush()
HierarchicalStreamWriter
flush in interface HierarchicalStreamWriterflush in class WriterWrapperpublic void close()
HierarchicalStreamWriter
close in interface HierarchicalStreamWriterclose in class WriterWrapperpublic int state()
STATE_OPEN,
STATE_NODE_START,
STATE_VALUE,
STATE_NODE_END,
STATE_CLOSED
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||