|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteios.io.XMLCrudeWriterImpl
org.proteios.io.XMLCrudeWriter2Impl
public class XMLCrudeWriter2Impl
This class supports crude XML writing, with some added convenience methods. This class contains some methods that may help writing XML files. It was created as support for e.g. writing single tags with XMLStreamWriter could not be found. To get consistent indentation and change to a new line, the following rules are used: 1. A start element or comment starts a new line. 2. An end element starts a new line, unless following data. 3. Indentation level is increased by one before start element. 4. Indentation level is decreased by one after end element. To avoid having the outermost element block indented, the indentaiion level starts at -1 instead of 0.
| Constructor Summary | |
|---|---|
XMLCrudeWriter2Impl(OutputStream outStream)
Constructor that takes an output stream as parameter. |
|
| Method Summary | |
|---|---|
void |
writeEndTag(String element)
Writes XML end tag for XML block. |
void |
writeSimpleElementPair(String elementName,
String data)
Convenience method for writing simple element pair. |
void |
writeStartListTag(String element,
int count)
Writes XML start list tag for XML block. |
void |
writeStartTag(String element)
Writes XML start tag for XML block. |
| Methods inherited from class org.proteios.io.XMLCrudeWriterImpl |
|---|
close, flush, getByteBufferSize, getOutStream, isIndentationUsed, setByteBufferSize, setIndentationUsed, setOutStream, writeAttribute, writeCharacters, writeComment, writeEndDocument, writeEndElement, writeIndentedText, writeNamespace, writeSingleElementEnd, writeStartDocument, writeStartElement, writeStartElementEnd, writeStyleSheetHeader |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.proteios.io.XMLCrudeWriter |
|---|
close, flush, getOutStream, isIndentationUsed, setIndentationUsed, setOutStream, writeAttribute, writeCharacters, writeComment, writeEndDocument, writeEndElement, writeNamespace, writeSingleElementEnd, writeStartDocument, writeStartElement, writeStartElementEnd |
| Constructor Detail |
|---|
public XMLCrudeWriter2Impl(OutputStream outStream)
outStream - The FileWriter output stream to use.| Method Detail |
|---|
public void writeStartTag(String element)
throws javax.xml.stream.XMLStreamException
writeStartTag in interface XMLCrudeWriter2element - String with element name.
javax.xml.stream.XMLStreamException - If there is an XML Stream related error
public void writeStartListTag(String element,
int count)
throws javax.xml.stream.XMLStreamException
writeStartListTag in interface XMLCrudeWriter2element - String with element name.count - int the number of XML blocks in the list.
javax.xml.stream.XMLStreamException - If there is an XML Stream related error
public void writeEndTag(String element)
throws javax.xml.stream.XMLStreamException
writeEndTag in interface XMLCrudeWriter2element - String with element name.
javax.xml.stream.XMLStreamException - If there is an XML Stream related error
public void writeSimpleElementPair(String elementName,
String data)
throws javax.xml.stream.XMLStreamException
writeSimpleElementPair in interface XMLCrudeWriter2elementName - String with element name.data - String with element data.
javax.xml.stream.XMLStreamException - If there is an XML Stream related error
|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||