public interface ResultWriter
Comments can be written anywhere to the result tree but might not be supported by implementations and are always skipped by result readers. They can however increase readability in certain cases.
Result names are optional.
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the writer and underlying streams.
|
void |
writeDouble(java.lang.String name,
double value)
A shorthand method for
|
void |
writeEndArray()
Writes the end of a result array.
|
void |
writeEndArrayItem()
Writes the end of a result array bucket.
|
void |
writeEndNode()
Writes the end of a result node.
|
void |
writeEndResults()
Writes the end of the results.
|
void |
writeLong(java.lang.String name,
long value)
A shorthand method for
|
void |
writeStartArray(java.lang.String name)
Writes the beginning of a result array.
|
void |
writeStartArrayItem(long index)
Writes the beginning of a result array bucket.
|
void |
writeStartNode(java.lang.String type,
java.lang.String name)
Writes the beginning of a result node.
|
void |
writeStartResults()
Writes the beginning of the results.
|
void |
writeString(java.lang.String name,
java.lang.String value)
A shorthand method for
|
void close() throws PrintException
PrintException
void writeStartResults() throws PrintException
writeEndResults
.PrintException
- if any error in writing the results occursvoid writeEndResults() throws PrintException
writeStartResults
and all other
writeStartXXX
must have been matched by their
writeEndXXX
counterparts.PrintException
- if any error in writing the results occursvoid writeStartNode(java.lang.String type, java.lang.String name) throws PrintException
writeEndNode
.type
- of the result nodePrintException
- if any error in writing the results occursvoid writeEndNode() throws PrintException
writeStartNode
.PrintException
- if any error in writing the results occursvoid writeStartArray(java.lang.String name) throws PrintException
writeEndArray
.PrintException
- if any error in writing the results occursvoid writeEndArray() throws PrintException
writeStartArray
.PrintException
- if any error in writing the results occursvoid writeStartArrayItem(long index) throws PrintException
writeEndBucket
. It is only legal to call this method in an array.PrintException
- if any error in writing the results occursvoid writeEndArrayItem() throws PrintException
writeStartBucket
.PrintException
- if any error in writing the results occursvoid writeLong(java.lang.String name, long value) throws PrintException
<code> writeLong(value); writeName(name); </code>
name
- name of the resultvalue
- value of the resultPrintException
- if any error in writing the results occursvoid writeDouble(java.lang.String name, double value) throws PrintException
<code> writeDouble(value); writeName(name); </code>
name
- name of the resultvalue
- value of the resultPrintException
- if any error in writing the results occursvoid writeString(java.lang.String name, java.lang.String value) throws PrintException
<code> writeString(value); writeName(name); </code>
name
- name of the resultvalue
- value of the resultPrintException
- if any error in writing the results occurs