org.ho.yaml
Interface YamlOperations

All Known Implementing Classes:
YamlConfig

public interface YamlOperations

This interfaces contains all commonly used Yaml functions. Yaml contains all of these methods as static methods for convient access while YamlConfig implements this interface.


Method Summary
 java.lang.String dump(java.lang.Object obj)
          Dumps an object into Yaml format
 java.lang.String dump(java.lang.Object obj, boolean minimalOutput)
          Dumps an object into Yaml format
 void dump(java.lang.Object obj, java.io.File file)
          Dumps an object to a file in Yaml format
 void dump(java.lang.Object obj, java.io.File file, boolean minimalOutput)
          Dumps an object to a file in Yaml format
 java.lang.String dumpStream(java.util.Iterator iterator)
          Dumps a stream of objects specified with an iterator to a String in Yaml format, one document per object
 java.lang.String dumpStream(java.util.Iterator iterator, boolean minimalOutput)
          Dumps a stream of objects specified with an iterator to a String in Yaml format, one document per object
 void dumpStream(java.util.Iterator iterator, java.io.File file)
          Dumps a stream of objects specified with an iterator to a file in Yaml format, one document per object
 void dumpStream(java.util.Iterator iterator, java.io.File file, boolean minimalOutput)
          Dumps a stream of objects specified with an iterator to a file in Yaml format, one document per object
 java.lang.Object load(java.io.File file)
          Loads one object from a file in Yaml format
 java.lang.Object load(java.io.InputStream in)
          Loads one object from an input stream
 java.lang.Object load(java.io.Reader in)
          Loads one object from a Reader
 java.lang.Object load(java.lang.String yamlText)
          Loads one object from a string of Yaml text
 YamlStream loadStream(java.io.File file)
          Loads the objects in a file in Yaml format into a YamlStream, which is used to iterate the objects in the file
 YamlStream loadStream(java.io.InputStream in)
          Loads the objects in input stream in Yaml format into a YamlStream, which is used to iterate the objects in the input stream
 YamlStream loadStream(java.io.Reader in)
          Loads the objects in reader in Yaml format into a YamlStream, which is used to iterate the objects in the input stream
 YamlStream loadStream(java.lang.String yamlText)
          Loads the objects in a Yaml text into a YamlStream, which is used to iterate the objects in the Yaml text
<T> YamlStream<T>
loadStreamOfType(java.io.File file, java.lang.Class<T> clazz)
          Loads the objects of a specified type in a file in Yaml format into a YamlStream, which is used to iterate the objects in the file
<T> YamlStream<T>
loadStreamOfType(java.io.InputStream in, java.lang.Class<T> clazz)
          Loads the objects of a specified type in an input stream in Yaml format into a YamlStream, which is used to iterate the objects in the input stream
<T> YamlStream<T>
loadStreamOfType(java.io.Reader in, java.lang.Class<T> clazz)
          Loads the objects of a specified type in a reader in Yaml format into a YamlStream, which is used to iterate the objects in the input stream
<T> YamlStream<T>
loadStreamOfType(java.lang.String yamlText, java.lang.Class<T> clazz)
          Loads the objects of a specified type in a in Yaml format into a YamlStream, which is used to iterate the objects in the file
<T> T
loadType(java.io.File file, java.lang.Class<T> clazz)
          Loads one object from a file in Yaml format
<T> T
loadType(java.io.InputStream in, java.lang.Class<T> clazz)
          Loads one object from an input stream of the specified type
<T> T
loadType(java.io.Reader in, java.lang.Class<T> clazz)
          Loads one object from a a reader of the specified type
<T> T
loadType(java.lang.String yamlText, java.lang.Class<T> clazz)
          Loads one object from a file in Yaml format
 

Method Detail

load

java.lang.Object load(java.io.InputStream in)
Loads one object from an input stream

Parameters:
in - the stream to read from
Returns:
the first object on the stream in Yaml format

load

java.lang.Object load(java.io.Reader in)
Loads one object from a Reader

Parameters:
in - the reader to read from
Returns:
the first object on the stream in Yaml format

load

java.lang.Object load(java.io.File file)
                      throws java.io.FileNotFoundException
Loads one object from a file in Yaml format

Parameters:
file - the file to read from
Returns:
the first object in the file in Yaml format
Throws:
java.io.FileNotFoundException

load

java.lang.Object load(java.lang.String yamlText)
Loads one object from a string of Yaml text

Parameters:
yamlText - the text to read from
Returns:
the first object in the Yaml text

loadType

<T> T loadType(java.io.InputStream in,
               java.lang.Class<T> clazz)
Loads one object from an input stream of the specified type

Type Parameters:
T - the specified type
Parameters:
in - the stream to read from
clazz - the class of the specified type
Returns:
the first object in the stream in Yaml format

loadType

<T> T loadType(java.io.Reader in,
               java.lang.Class<T> clazz)
Loads one object from a a reader of the specified type

Type Parameters:
T - the specified type
Parameters:
in - the reader to read from
clazz - the class of the specified type
Returns:
the first object in the stream in Yaml format

loadType

<T> T loadType(java.io.File file,
               java.lang.Class<T> clazz)
           throws java.io.FileNotFoundException
Loads one object from a file in Yaml format

Type Parameters:
T - the specified type
Parameters:
file - the file to read from
clazz - the class of the specified type
Returns:
the first object in the file in Yaml format
Throws:
java.io.FileNotFoundException

loadType

<T> T loadType(java.lang.String yamlText,
               java.lang.Class<T> clazz)
Loads one object from a file in Yaml format

Type Parameters:
T - the specified type
Parameters:
yamlText - the Yaml text
clazz - the class of the specified type
Returns:
the first object in the Yaml text

loadStream

YamlStream loadStream(java.io.InputStream in)
Loads the objects in input stream in Yaml format into a YamlStream, which is used to iterate the objects in the input stream

Parameters:
in - the stream to read from
Returns:
a YamlStream for iterating the objects

loadStream

YamlStream loadStream(java.io.Reader in)
Loads the objects in reader in Yaml format into a YamlStream, which is used to iterate the objects in the input stream

Parameters:
in - the reader to read from
Returns:
a YamlStream for iterating the objects

loadStream

YamlStream loadStream(java.io.File file)
                      throws java.io.FileNotFoundException
Loads the objects in a file in Yaml format into a YamlStream, which is used to iterate the objects in the file

Parameters:
file - the file to read from
Returns:
a YamlStream for iterating the objects
Throws:
java.io.FileNotFoundException

loadStream

YamlStream loadStream(java.lang.String yamlText)
Loads the objects in a Yaml text into a YamlStream, which is used to iterate the objects in the Yaml text

Parameters:
yamlText -
Returns:
a YamlStream for iterating the objects

loadStreamOfType

<T> YamlStream<T> loadStreamOfType(java.io.InputStream in,
                                   java.lang.Class<T> clazz)
Loads the objects of a specified type in an input stream in Yaml format into a YamlStream, which is used to iterate the objects in the input stream

Type Parameters:
T - the specified type
Parameters:
in - the stream to read from
clazz - the class of the specified type
Returns:
a YamlStream for iterating the objects

loadStreamOfType

<T> YamlStream<T> loadStreamOfType(java.io.Reader in,
                                   java.lang.Class<T> clazz)
Loads the objects of a specified type in a reader in Yaml format into a YamlStream, which is used to iterate the objects in the input stream

Type Parameters:
T - the specified type
Parameters:
in - the reader to read from
clazz - the class of the specified type
Returns:
a YamlStream for iterating the objects

loadStreamOfType

<T> YamlStream<T> loadStreamOfType(java.io.File file,
                                   java.lang.Class<T> clazz)
                               throws java.io.FileNotFoundException
Loads the objects of a specified type in a file in Yaml format into a YamlStream, which is used to iterate the objects in the file

Type Parameters:
T - the specified type
Parameters:
file - the file to read from
clazz - the class of the specified type
Returns:
a YamlStream for iterating the objects
Throws:
java.io.FileNotFoundException

loadStreamOfType

<T> YamlStream<T> loadStreamOfType(java.lang.String yamlText,
                                   java.lang.Class<T> clazz)
Loads the objects of a specified type in a in Yaml format into a YamlStream, which is used to iterate the objects in the file

Type Parameters:
T - the specified type
Parameters:
yamlText - the text to read from
clazz - the class of the specified type
Returns:
a YamlStream for iterating the objects
Throws:
java.io.FileNotFoundException

dump

void dump(java.lang.Object obj,
          java.io.File file)
          throws java.io.FileNotFoundException
Dumps an object to a file in Yaml format

Parameters:
obj - the object to dump
file - the file to dump to
Throws:
java.io.FileNotFoundException

dump

void dump(java.lang.Object obj,
          java.io.File file,
          boolean minimalOutput)
          throws java.io.FileNotFoundException
Dumps an object to a file in Yaml format

Parameters:
obj - the object to dump
file - the file to dump to
minimalOutput - whether minimal output is on
Throws:
java.io.FileNotFoundException

dump

java.lang.String dump(java.lang.Object obj)
Dumps an object into Yaml format

Parameters:
obj - the object to dump
Returns:
a String in Yaml format representing the object

dump

java.lang.String dump(java.lang.Object obj,
                      boolean minimalOutput)
Dumps an object into Yaml format

Parameters:
obj - the object to dump
minimalOutput - whether minimal output is on
Returns:
a String in Yaml format representing the object

dumpStream

void dumpStream(java.util.Iterator iterator,
                java.io.File file)
                throws java.io.FileNotFoundException
Dumps a stream of objects specified with an iterator to a file in Yaml format, one document per object

Parameters:
iterator - the iterator to read objects from
file - the file to write to
Throws:
java.io.FileNotFoundException

dumpStream

void dumpStream(java.util.Iterator iterator,
                java.io.File file,
                boolean minimalOutput)
                throws java.io.FileNotFoundException
Dumps a stream of objects specified with an iterator to a file in Yaml format, one document per object

Parameters:
iterator - the iterator to read objects from
file - the file to write to
minimalOutput - whether minimal output is on
Throws:
java.io.FileNotFoundException

dumpStream

java.lang.String dumpStream(java.util.Iterator iterator)
Dumps a stream of objects specified with an iterator to a String in Yaml format, one document per object

Parameters:
iterator - the iterator to read objects from
Returns:
a String in Yaml format representing the object

dumpStream

java.lang.String dumpStream(java.util.Iterator iterator,
                            boolean minimalOutput)
Dumps a stream of objects specified with an iterator to a String in Yaml format, one document per object

Parameters:
iterator - the iterator to read objects from
minimalOutput - whether minimal output is on
Returns:
a String in Yaml format representing the object