|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.parancoe.yaml.YamlConfig
public class YamlConfig
YamlConfig represents a Jyaml configuration and contains all methods in
YamlOperations and is used as the entry point for Yaml operations
when multiple Jyaml configurations are used in the same application. See
YamlOperations for documentation on the Yaml entry point methods.
| Constructor Summary | |
|---|---|
YamlConfig()
|
|
| Method Summary | ||
|---|---|---|
java.lang.Object |
clone()
|
|
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 |
|
static YamlConfig |
fromFile(java.lang.String filename)
Loads a YamlConfig from a Yaml configuration file |
|
static YamlConfig |
fromResource(java.lang.String filename)
Loads a YamlConfig from a resource on the classpath |
|
static YamlConfig |
getDefaultConfig()
The default Jyaml configuration |
|
java.lang.String |
getIndentAmount()
Returns the indentation amount used for one indentation level. |
|
BiDirectionalMap<java.lang.String,java.lang.String> |
getTransfers()
returns the transfer-to-classname mapping for this configuration |
|
boolean |
isMinimalOutput()
Returns whether the minimal output option is set. |
|
boolean |
isSuppressWarnings()
returns whether the suppress warnings option is on |
|
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.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.lang.String yamlText)
Loads the objects in a Yaml text into a YamlStream, which is used to iterate the objects in the Yaml text |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
loadType(java.io.File file,
java.lang.Class<T> clazz)
Loads one object from a file in Yaml format |
|
|
loadType(java.io.InputStream in,
java.lang.Class<T> clazz)
Loads one object from an input stream of the specified type |
|
|
loadType(java.lang.String yamlText,
java.lang.Class<T> clazz)
Loads one object from a file in Yaml format |
|
void |
setIndentAmount(java.lang.String indentAmount)
Sets indentation amount. |
|
void |
setMinimalOutput(boolean minimalOutput)
Sets the minimal output option. |
|
void |
setSuppressWarnings(boolean suppressWarnings)
sets the suppress warnings option |
|
void |
setTransfers(BiDirectionalMap<java.lang.String,java.lang.String> transferDictionary)
sets the transfer-to-classname mapping for this configuration |
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public YamlConfig()
| Method Detail |
|---|
public static YamlConfig getDefaultConfig()
public java.lang.String getIndentAmount()
public void setIndentAmount(java.lang.String indentAmount)
indentAmount - must be a string consisting only of spaces.public boolean isMinimalOutput()
public void setMinimalOutput(boolean minimalOutput)
minimalOutput - true for on; false for off.public boolean isSuppressWarnings()
public void setSuppressWarnings(boolean suppressWarnings)
suppressWarnings - true for on; false for off.public BiDirectionalMap<java.lang.String,java.lang.String> getTransfers()
public void setTransfers(BiDirectionalMap<java.lang.String,java.lang.String> transferDictionary)
transferDictionary - a transfer-classname bi-directional mappublic java.lang.Object clone()
clone in class java.lang.Object
public static YamlConfig fromFile(java.lang.String filename)
throws java.io.FileNotFoundException,
java.io.EOFException
filename - the name of the file to load
java.io.FileNotFoundException
java.io.EOFException
public static YamlConfig fromResource(java.lang.String filename)
throws java.io.EOFException
filename - the name of the resource
java.io.EOFExceptionpublic java.lang.Object load(java.io.InputStream in)
YamlOperations
load in interface YamlOperationsin - the stream to read from
public java.lang.Object load(java.io.File file)
throws java.io.FileNotFoundException
YamlOperations
load in interface YamlOperationsfile - the file to read from
java.io.FileNotFoundExceptionpublic java.lang.Object load(java.lang.String yamlText)
YamlOperations
load in interface YamlOperationsyamlText - the text to read from
public <T> T loadType(java.io.InputStream in,
java.lang.Class<T> clazz)
YamlOperations
loadType in interface YamlOperationsT - the specified typein - the stream to read fromclazz - the class of the specified type
public <T> T loadType(java.io.File file,
java.lang.Class<T> clazz)
throws java.io.FileNotFoundException
YamlOperations
loadType in interface YamlOperationsT - the specified typefile - the file to read fromclazz - the class of the specified type
java.io.FileNotFoundException
public <T> T loadType(java.lang.String yamlText,
java.lang.Class<T> clazz)
YamlOperations
loadType in interface YamlOperationsT - the specified typeyamlText - the Yaml textclazz - the class of the specified type
public YamlStream loadStream(java.io.InputStream in)
YamlOperations
loadStream in interface YamlOperationsin - the stream to read from
public YamlStream loadStream(java.io.File file)
throws java.io.FileNotFoundException
YamlOperations
loadStream in interface YamlOperationsfile - the file to read from
java.io.FileNotFoundExceptionpublic YamlStream loadStream(java.lang.String yamlText)
YamlOperations
loadStream in interface YamlOperations
public <T> YamlStream<T> loadStreamOfType(java.io.InputStream in,
java.lang.Class<T> clazz)
YamlOperations
loadStreamOfType in interface YamlOperationsT - the specified typein - the stream to read fromclazz - the class of the specified type
public <T> YamlStream<T> loadStreamOfType(java.io.File file,
java.lang.Class<T> clazz)
throws java.io.FileNotFoundException
YamlOperations
loadStreamOfType in interface YamlOperationsT - the specified typefile - the file to read fromclazz - the class of the specified type
java.io.FileNotFoundException
public <T> YamlStream<T> loadStreamOfType(java.lang.String yamlText,
java.lang.Class<T> clazz)
throws java.io.FileNotFoundException
YamlOperations
loadStreamOfType in interface YamlOperationsT - the specified typeyamlText - the text to read fromclazz - the class of the specified type
java.io.FileNotFoundException
public void dump(java.lang.Object obj,
java.io.File file)
throws java.io.FileNotFoundException
YamlOperations
dump in interface YamlOperationsobj - the object to dumpfile - the file to dump to
java.io.FileNotFoundException
public void dump(java.lang.Object obj,
java.io.File file,
boolean minimalOutput)
throws java.io.FileNotFoundException
YamlOperations
dump in interface YamlOperationsobj - the object to dumpfile - the file to dump tominimalOutput - whether minimal output is on
java.io.FileNotFoundException
public void dumpStream(java.util.Iterator iterator,
java.io.File file,
boolean minimalOutput)
throws java.io.FileNotFoundException
YamlOperations
dumpStream in interface YamlOperationsiterator - the iterator to read objects fromfile - the file to write tominimalOutput - whether minimal output is on
java.io.FileNotFoundException
public void dumpStream(java.util.Iterator iterator,
java.io.File file)
throws java.io.FileNotFoundException
YamlOperations
dumpStream in interface YamlOperationsiterator - the iterator to read objects fromfile - the file to write to
java.io.FileNotFoundExceptionpublic java.lang.String dump(java.lang.Object obj)
YamlOperations
dump in interface YamlOperationsobj - the object to dump
public java.lang.String dump(java.lang.Object obj,
boolean minimalOutput)
YamlOperations
dump in interface YamlOperationsobj - the object to dumpminimalOutput - whether minimal output is on
public java.lang.String dumpStream(java.util.Iterator iterator)
YamlOperations
dumpStream in interface YamlOperationsiterator - the iterator to read objects from
public java.lang.String dumpStream(java.util.Iterator iterator,
boolean minimalOutput)
YamlOperations
dumpStream in interface YamlOperationsiterator - the iterator to read objects fromminimalOutput - whether minimal output is on
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||