de.hpi.fgis.dude.output
Class JsonOutput
java.lang.Object
de.hpi.fgis.dude.output.AbstractDuDeOutput
de.hpi.fgis.dude.output.JsonOutput
- All Implemented Interfaces:
- DuDeOutput, AutoJsonable, Jsonable
public class JsonOutput
- extends AbstractDuDeOutput
JsonOutput
converts the passed DuDeObject
pairs into Json syntax. There are two different modes for writing the information to
the stream. The default mode writes only the identifying information while the other one prints the whole data of each DuDeObject
- Author:
- Matthias Pohl
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_HEADER
protected static final String DEFAULT_HEADER
- The default header of the
JsonOutput
.
- See Also:
- Constant Field Values
DEFAULT_FOOTER
protected static final String DEFAULT_FOOTER
- The default footer of the
JsonOutput
.
- See Also:
- Constant Field Values
FIRST_OBJECT_ATTRIBUTE
public static final String FIRST_OBJECT_ATTRIBUTE
- The attribute name of the first object within each pair.
- See Also:
- Constant Field Values
SECOND_OBJECT_ATTRIBUTE
public static final String SECOND_OBJECT_ATTRIBUTE
- The attribute name of the second object within each pair.
- See Also:
- Constant Field Values
SIMILARITY_ATTRIBUTE
public static final String SIMILARITY_ATTRIBUTE
- The attribute name of the similarity that belongs to each pair
- See Also:
- Constant Field Values
JsonOutput
public JsonOutput(OutputStream out)
throws IOException
- Initializes a
JsonOutput
formatter. This instance writes only the identifying information of each object to the stream.
- Parameters:
out
- The stream to which the data shall be written.
- Throws:
IOException
- If an error occurs while writing to the OutputStream
.
JsonOutput
public JsonOutput(File out)
throws IOException
- Initializes a
JsonOutput
formatter. This instance writes only the identifying information of each object to the stream.
- Parameters:
out
- The file to which the data shall be written.
- Throws:
IOException
- If an error occurs while writing to the OutputStream
.
JsonOutput
protected JsonOutput()
- Internal constructor for
Jsonable
deserialization.
getDefaultHeader
protected String getDefaultHeader()
- Returns
DEFAULT_HEADER
.
- Overrides:
getDefaultHeader
in class AbstractDuDeOutput
- Returns:
- Returns an empty String.
getDefaultFooter
protected String getDefaultFooter()
- Returns
DEFAULT_FOOTER
.
- Overrides:
getDefaultFooter
in class AbstractDuDeOutput
- Returns:
- Returns an empty String.
write
public void write(DuDeObjectPair pair)
throws IOException
- Description copied from interface:
DuDeOutput
- Writes the
DuDeObjectPair
onto an stream.
- Specified by:
write
in interface DuDeOutput
- Specified by:
write
in class AbstractDuDeOutput
- Parameters:
pair
- A pair of two DuDeObject
s that are written into an OutputStream
.
- Throws:
IOException
- If an error occurs while writing onto the stream.
Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.