public class KOML extends Object implements RevisionHandler
Modifier and Type | Field and Description |
---|---|
static String |
FILE_EXTENSION
the extension for KOML files (including '.')
|
Constructor and Description |
---|
KOML() |
Modifier and Type | Method and Description |
---|---|
String |
getRevision()
Returns the revision string.
|
static boolean |
isPresent()
returns whether KOML is present or not, i.e.
|
static Object |
read(File file)
reads the XML-serialized object from the given file
|
static Object |
read(InputStream stream)
reads the XML-serialized object from a stream
|
static Object |
read(String filename)
reads the XML-serialized object from the given file
|
static boolean |
write(File file,
Object o)
write the XML-serialized object to the given file
|
static boolean |
write(OutputStream stream,
Object o)
writes the XML-serialized object to a stream
|
static boolean |
write(String filename,
Object o)
writes the XML-serialized object to the given file
|
public static final String FILE_EXTENSION
public static boolean isPresent()
public static Object read(String filename) throws Exception
filename
- the file to deserialize the object fromException
- if something goes wrong while reading from the filepublic static Object read(File file) throws Exception
file
- the file to deserialize the object fromException
- if something goes wrong while reading from the filepublic static Object read(InputStream stream) throws Exception
stream
- the stream to deserialize the object fromException
- if something goes wrong while reading from the streampublic static boolean write(String filename, Object o) throws Exception
filename
- the file to serialize the object too
- the object to write to the fileException
- if something goes wrong while writing to the filepublic static boolean write(File file, Object o) throws Exception
file
- the file to serialize the object too
- the object to write to the fileException
- if something goes wrong while writing to the filepublic static boolean write(OutputStream stream, Object o) throws Exception
stream
- the stream to serialize the object too
- the object to write to the streamException
- if something goes wrong while writing to the streampublic String getRevision()
getRevision
in interface RevisionHandler
Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.