|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface XMLCrudeWriter2
This interface defines crude XML writing, with some added convenience methods. This interface 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. It is up to the implementations to decide on indentation, which may be ignored if desired, but if guidelines are requested, recommended use is as follows: 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.
| 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 interface org.proteios.io.XMLCrudeWriter |
|---|
close, flush, getOutStream, isIndentationUsed, setIndentationUsed, setOutStream, writeAttribute, writeCharacters, writeComment, writeEndDocument, writeEndElement, writeNamespace, writeSingleElementEnd, writeStartDocument, writeStartElement, writeStartElementEnd |
| Method Detail |
|---|
void writeStartTag(String element)
throws javax.xml.stream.XMLStreamException
element - String with element name.
javax.xml.stream.XMLStreamException - If there is an XML Stream related error
void writeStartListTag(String element,
int count)
throws javax.xml.stream.XMLStreamException
element - 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
void writeEndTag(String element)
throws javax.xml.stream.XMLStreamException
element - String with element name.
javax.xml.stream.XMLStreamException - If there is an XML Stream related error
void writeSimpleElementPair(String elementName,
String data)
throws javax.xml.stream.XMLStreamException
elementName - 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 | |||||||||