|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.parancoe.yaml.YamlDecoder
public class YamlDecoder
YamlDecoder - The usage of YamlDecoder mirrors that of java.beans.XMLDecoder.
You create a decoder, make some calls to readObject, and then close the
decoder. In most cases you may find it is not necessary to access this class
directly as Yaml contain methods for the most common usages. The
utility functions that were previously in this class are now in Yaml.
| Constructor Summary | |
|---|---|
YamlDecoder(java.io.File file)
Creates a YamlDecoder that reads from specifed file. |
|
YamlDecoder(java.io.InputStream in)
Creates a YamlDecoder that reads from specified stream. |
|
YamlDecoder(java.lang.String filename)
Creates a YamlDecoder that reads from specifed file. |
|
| Method Summary | ||
|---|---|---|
YamlStream |
asStream()
|
|
|
asStreamOfType(java.lang.Class<T> clazz)
|
|
void |
close()
Closes this decoder instance. |
|
YamlConfig |
getConfig()
returns the Jyaml configuration for this Decoder |
|
boolean |
isSuppressWarnings()
returns whether the suppress warnings option is on |
|
java.lang.Object |
readObject()
Reads one object from the Yaml stream. |
|
|
readObjectOfType(java.lang.Class<T> clazz)
Returns the next object from the Yaml stream given the expected type. |
|
void |
setConfig(YamlConfig config)
set the Jyaml configuration for this decoder |
|
void |
setSuppressWarnings(boolean suppressWarnings)
sets the suppress warnings option |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public YamlDecoder(java.io.InputStream in)
in - InputStream to read from.
public YamlDecoder(java.io.File file)
throws java.io.FileNotFoundException
file - file to read from.
java.io.FileNotFoundException
public YamlDecoder(java.lang.String filename)
throws java.io.FileNotFoundException
filename - name of file to read from.
java.io.FileNotFoundException| Method Detail |
|---|
public java.lang.Object readObject()
throws java.io.EOFException
java.io.EOFException - -
if the end of the Yaml stream has been reached.public <T> YamlStream asStreamOfType(java.lang.Class<T> clazz)
public YamlStream asStream()
public <T> T readObjectOfType(java.lang.Class<T> clazz)
throws java.io.EOFException
T - The type of the object expected.clazz - the class representing the type of the object expected.
java.io.EOFExceptionpublic void close()
public boolean isSuppressWarnings()
public void setSuppressWarnings(boolean suppressWarnings)
suppressWarnings - true for on; false for off.public YamlConfig getConfig()
public void setConfig(YamlConfig config)
config - the config object to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||