|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.presentation.Sink
biz.c24.io.api.presentation.SAXSink
public class SAXSink
A sink for generating XML from data objects.
A common usage of this class would be:
SAXSink snk = new SAXSink(); // The following is dependent on the actual SAX event source in use src.setContentHandler(saxEventSink.asContentHandler()); src.writeObject(myObj);
Please note this class does not use the inherited Sink.getOutputStream()
or Sink.getWriter()
methods.
Note that this implementation is not synchronized. If multiple threads use an instance concurrently, it must be synchronized externally.
Sink
,
Serialized FormConstructor Summary | |
---|---|
SAXSink()
Constructs a new instance. |
|
SAXSink(SAXSink clone)
Constructs a new instance cloned from clone . |
Method Summary | |
---|---|
Object |
clone()
|
DecimalFormat |
getNumberFormat()
Returns the decimal format object used to format numbers into Strings. |
boolean |
isWriteOptionalDefaultValues()
Returns whether optional default element and attribute values will be produced. |
boolean |
isWriteOptionalFixedValues()
Returns whether optional fixed element and attribute values will be produced. |
void |
setContentHandler(ContentHandler contentHandler)
Sets the content handler to which SAX events with be sent. |
void |
setLexicalHandler(LexicalHandler lexicalHandler)
Sets the lexical handler to which SAX events with be sent. |
void |
setNumberFormat(DecimalFormat numberFormat)
Sets the decimal format object used to format numbers into Strings. |
void |
setWriteOptionalDefaultValues(boolean writeOptionalDefaultValues)
Sets whether optional default element and attribute values will be produced. |
void |
setWriteOptionalFixedValues(boolean writeOptionalFixedValues)
Sets whether optional fixed element and attribute values will be produced. |
void |
writeObject(ComplexDataObject obj)
Writes an object to the writer or output stream that has been set. |
Methods inherited from class biz.c24.io.api.presentation.Sink |
---|
checkInit, clearBatchIterators, getEncoding, getOutputStream, getWriter, registerBatchIterator, setEncoding, setOutputStream, setWriter, stream, unregisterBatchIterator, writer |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SAXSink()
public SAXSink(SAXSink clone)
clone
.
clone
- The instance to clone.Method Detail |
---|
public void setContentHandler(ContentHandler contentHandler)
The handler should be used with a SAX event sink - a consumer of SAX events (or possibly a SAXSource
).
contentHandler
- The content handler.public void setLexicalHandler(LexicalHandler lexicalHandler)
The handler should be used with a SAX event sink - a consumer of SAX events (or possibly a SAXSource
).
lexicalHandler
- The lexical handler.public boolean isWriteOptionalDefaultValues()
public void setWriteOptionalDefaultValues(boolean writeOptionalDefaultValues)
writeOptionalDefaultValues
- The new value.public boolean isWriteOptionalFixedValues()
public void setWriteOptionalFixedValues(boolean writeOptionalFixedValues)
writeOptionalFixedValues
- The new value.public DecimalFormat getNumberFormat()
null
if the format has not been set up explicitly.public void setNumberFormat(DecimalFormat numberFormat)
numberFormat
- The new format to use, or null
to use the default.public void writeObject(ComplexDataObject obj) throws IOException
Sink
writeObject
in class Sink
obj
- The object to be written.
IOException
- If the complete object could not be written for any reason.public Object clone()
clone
in class Sink
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |