|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspark.data.io.JSONWriter
public class JSONWriter
This is a concrete implementation of SparkWriter that will write Spark data out in the JSON format.
Constructor Summary | |
---|---|
JSONWriter()
This creates a new JSONWriter. |
|
JSONWriter(java.lang.String[] typePackageList)
This creates a new JSONWriter. |
|
JSONWriter(java.lang.String[] typePackageList,
java.io.OutputStream output)
This creates a new JSONWriter. |
Method Summary | |
---|---|
void |
close()
this will close the stream and flush any output buffers. |
void |
flush()
This will flush the stream's buffers |
TypeFactory |
getTypeFactory()
This will return the TypeFactory currently being used. |
boolean |
isPretty()
This returns true if the output is being pretty printed for human consumption rather than condensed for files and network message uses. |
void |
setOutput(java.io.OutputStream output)
This will set the OutputStream to which the data is to be written. |
void |
setPretty(boolean p)
This tells the writer whether the output should be pretty-printed for human consumption or condensed for system communication or storage. |
void |
setTypeFactory(TypeFactory factory)
This is the type factory to be used when converting internal Java classes into an external form. |
java.lang.String |
toString(SV value)
This will write the value to a String. |
void |
write(SV value)
This is the heart of the SparkWriter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSONWriter()
public JSONWriter(java.lang.String[] typePackageList)
typePackageList
- this is the restricted list
of packages from which objects can be written. See TypeFactoryReflect for
complete documentation on the package list.public JSONWriter(java.lang.String[] typePackageList, java.io.OutputStream output)
typePackageList
- this is the restricted list
of packages from which objects can be written. See TypeFactoryReflect for
complete documentation on the package list.output
- this is the output stream to which the JSON is to
be written.Method Detail |
---|
public void setTypeFactory(TypeFactory factory)
SparkWriter
setTypeFactory
in interface SparkWriter
factory
- the type factory to be used.public TypeFactory getTypeFactory()
SparkWriter
getTypeFactory
in interface SparkWriter
public void setOutput(java.io.OutputStream output)
SparkWriter
setOutput
in interface SparkWriter
output
- where the output is to be sent.public void write(SV value)
SparkWriter
write
in interface SparkWriter
value
- the value to be written.public java.lang.String toString(SV value)
SparkWriter
toString
in interface SparkWriter
value
- the value to be written out.
public boolean isPretty()
SparkWriter
isPretty
in interface SparkWriter
public void setPretty(boolean p)
SparkWriter
setPretty
in interface SparkWriter
p
- true if the output is for human consumption.public void close()
SparkWriter
close
in interface SparkWriter
public void flush()
SparkWriter
flush
in interface SparkWriter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |