public interface StreamWriter
OutputStream.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the
OutputStream associated with this object. |
String |
getPostfix()
Returns a string of data that must appear at the end of the data stream.
|
String |
getPrefix()
Returns a string of data that must appear at the start of the data
stream.
|
void |
writeAttribute(String name,
Boolean value)
Writes a
Boolean attribute with the specified name and
value. |
void |
writeAttribute(String name,
String value)
Writes a
String attribute with the specified name and
value. |
void |
writeEndArray()
Writes the end of an array.
|
void |
writeEndDocument()
Writes the data that is compulsory to appear at the end of the data
structure.
|
void |
writeEndObject()
Writes the end of an object.
|
void |
writeStartArray(String element)
Writes the start of an array, with the specified
name. |
void |
writeStartDocument()
Writes the data that is compulsory to appear at the start of the data
structure.
|
void |
writeStartObject(String element)
Writes the start of a new object, with the specified
name. |
String getPostfix()
String getPrefix()
void writeStartDocument()
throws Exception
<?xml version="1.0" ?>Exception - Any exception thrown while writing. E.g. for JSON this
might be a
JsonGenerationException.void writeEndDocument()
throws Exception
Exception - Any exception thrown while writing. E.g. for JSON this
might be a
JsonGenerationException.void writeStartObject(String element) throws Exception
name.element - The name of the objectException - Any exception thrown while writing. E.g. for JSON this
might be a
JsonGenerationException.void writeEndObject()
throws Exception
Exception - Any exception thrown while writing. E.g. for JSON this
might be a
JsonGenerationException.void writeStartArray(String element) throws Exception
name. If the
data structure doesn't support arrays, this method will do nothing.element - The name of the arrayException - Any exception thrown while writing. E.g. for JSON this
might be a
JsonGenerationException.void writeEndArray()
throws Exception
Exception - Any exception thrown while writing. E.g. for JSON this
might be a
JsonGenerationException.void writeAttribute(String name, String value) throws Exception
String attribute with the specified name and
value. E.g. for JSON this will write: "name":"value".name - The name of the attributevalue - The value of the attributeException - Any exception thrown while writing. E.g. for JSON this
might be a
JsonGenerationException.void writeAttribute(String name, Boolean value) throws Exception
Boolean attribute with the specified name and
value. E.g. for JSON this will write: "name":true/false.name - The name of the attributevalue - The value of the attributeException - Any exception thrown while writing. E.g. for JSON this
might be a
JsonGenerationException.void close()
throws Exception
OutputStream associated with this object. Some
OutputStreams require closing before any data will be written.Exception - Any exception thrown while closing the OutputStream.
E.g. for JSON this might be a
JsonGenerationException.Copyright © 2019. All rights reserved.