|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ho.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.
Field Summary | |
---|---|
static java.lang.String |
CONSTRUCTOR_SCOPE
|
static java.lang.String |
DEFAULT
|
static java.lang.String |
FIELD_SCOPE
|
static java.lang.String |
PRIVATE
|
static java.lang.String |
PROPERTY_SCOPE
|
static java.lang.String |
PROTECTED
|
static java.lang.String |
PUBLIC
|
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 |
|
java.lang.String |
getDateFormat()
|
|
java.text.DateFormat |
getDateFormatter()
Returns a DateFormat object for converting dates to strings. |
|
java.util.Map<java.lang.String,java.lang.String> |
getDecodingAccessScope()
|
|
static YamlConfig |
getDefaultConfig()
The default Jyaml configuration |
|
java.lang.String |
getEncoding()
Returns the charset (or encoding) to use for both encoding and decoding. |
|
java.util.Map<java.lang.String,java.lang.String> |
getEncodingAccessScope()
|
|
java.util.Map<java.lang.String,java.lang.Object> |
getHandlers()
|
|
java.lang.String |
getIndentAmount()
Returns the indentation amount used for one indentation level. |
|
org.ho.util.BiDirectionalMap<java.lang.String,java.lang.String> |
getTransfers()
returns the transfer-to-classname mapping for this configuration |
|
ObjectWrapper |
getWrapper(java.lang.Class clazz)
|
|
ObjectWrapper |
getWrapper(java.lang.Object obj)
|
|
ObjectWrapper |
getWrapper(java.lang.String classname)
|
|
ObjectWrapper |
getWrapperSetContent(java.lang.String classname,
java.lang.String content)
|
|
boolean |
isConstructorAccessibleForDecoding(java.lang.Class clazz)
|
|
boolean |
isFieldAccessibleForDecoding(java.lang.reflect.Field field)
|
|
boolean |
isFieldAccessibleForEncoding(java.lang.reflect.Field field)
|
|
boolean |
isMinimalOutput()
Returns whether the minimal output option is set. |
|
boolean |
isPropertyAccessibleForDecoding(java.beans.PropertyDescriptor prop)
|
|
boolean |
isPropertyAccessibleForEncoding(java.beans.PropertyDescriptor prop)
|
|
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.io.Reader reader)
Loads one object from a Reader |
|
java.lang.Object |
load(java.lang.String yamlText)
Loads one object from a string of Yaml text |
|
java.lang.Object |
load(YamlDecoder dec)
|
|
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 reader)
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 |
|
YamlStream |
loadStream(YamlDecoder dec)
|
|
|
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.io.Reader reader,
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 |
|
|
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 |
|
|
loadStreamOfType(YamlDecoder dec,
java.lang.Class<T> clazz)
|
|
|
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.io.Reader reader,
java.lang.Class<T> clazz)
Loads one object from a a reader of the specified type |
|
|
loadType(java.lang.String yamlText,
java.lang.Class<T> clazz)
Loads one object from a file in Yaml format |
|
|
loadType(YamlDecoder dec,
java.lang.Class<T> clazz)
|
|
void |
setDateFormat(java.lang.String dateFormat)
|
|
void |
setDecodingAccessScope(java.util.Map<java.lang.String,java.lang.String> decodingAccessScope)
|
|
void |
setEncoding(java.lang.String charset)
sets the charset (or encoding) to use for both encoding and decoding. |
|
void |
setEncodingAccessScope(java.util.Map<java.lang.String,java.lang.String> encodingAccessScope)
|
|
void |
setHandlers(java.util.Map<java.lang.String,java.lang.Object> handlers)
|
|
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(org.ho.util.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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONSTRUCTOR_SCOPE
public static final java.lang.String FIELD_SCOPE
public static final java.lang.String PROPERTY_SCOPE
public static final java.lang.String PRIVATE
public static final java.lang.String DEFAULT
public static final java.lang.String PROTECTED
public static final java.lang.String PUBLIC
Constructor Detail |
---|
public YamlConfig()
Method Detail |
---|
public static YamlConfig getDefaultConfig()
public java.lang.String getEncoding()
public void setEncoding(java.lang.String charset)
encoding
- 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 org.ho.util.BiDirectionalMap<java.lang.String,java.lang.String> getTransfers()
public void setTransfers(org.ho.util.BiDirectionalMap<java.lang.String,java.lang.String> transferDictionary)
transferDictionary
- a transfer-classname bi-directional mappublic java.util.Map<java.lang.String,java.lang.Object> getHandlers()
public void setHandlers(java.util.Map<java.lang.String,java.lang.Object> handlers)
public ObjectWrapper getWrapper(java.lang.Object obj)
public ObjectWrapper getWrapper(java.lang.Class clazz)
public ObjectWrapper getWrapper(java.lang.String classname)
public ObjectWrapper getWrapperSetContent(java.lang.String classname, java.lang.String content)
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getDateFormat()
public void setDateFormat(java.lang.String dateFormat)
public java.text.DateFormat getDateFormatter()
If no date format has been set then returns null.
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.EOFException
public java.lang.Object load(YamlDecoder dec)
public java.lang.Object load(java.io.InputStream in)
YamlOperations
load
in interface YamlOperations
in
- the stream to read from
public java.lang.Object load(java.io.Reader reader)
YamlOperations
load
in interface YamlOperations
reader
- the reader to read from
public java.lang.Object load(java.io.File file) throws java.io.FileNotFoundException
YamlOperations
load
in interface YamlOperations
file
- the file to read from
java.io.FileNotFoundException
public java.lang.Object load(java.lang.String yamlText)
YamlOperations
load
in interface YamlOperations
yamlText
- the text to read from
public <T> T loadType(YamlDecoder dec, java.lang.Class<T> clazz)
public <T> T loadType(java.io.InputStream in, java.lang.Class<T> clazz)
YamlOperations
loadType
in interface YamlOperations
T
- the specified typein
- the stream to read fromclazz
- the class of the specified type
public <T> T loadType(java.io.Reader reader, java.lang.Class<T> clazz)
YamlOperations
loadType
in interface YamlOperations
T
- the specified typereader
- the reader 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 YamlOperations
T
- 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 YamlOperations
T
- the specified typeyamlText
- the Yaml textclazz
- the class of the specified type
public YamlStream loadStream(YamlDecoder dec)
public YamlStream loadStream(java.io.Reader reader)
YamlOperations
loadStream
in interface YamlOperations
reader
- the reader to read from
public YamlStream loadStream(java.io.InputStream in)
YamlOperations
loadStream
in interface YamlOperations
in
- the stream to read from
public YamlStream loadStream(java.io.File file) throws java.io.FileNotFoundException
YamlOperations
loadStream
in interface YamlOperations
file
- the file to read from
java.io.FileNotFoundException
public YamlStream loadStream(java.lang.String yamlText)
YamlOperations
loadStream
in interface YamlOperations
public <T> YamlStream<T> loadStreamOfType(YamlDecoder dec, java.lang.Class<T> clazz)
public <T> YamlStream<T> loadStreamOfType(java.io.Reader reader, java.lang.Class<T> clazz)
YamlOperations
loadStreamOfType
in interface YamlOperations
T
- the specified typereader
- the reader to read fromclazz
- the class of the specified type
public <T> YamlStream<T> loadStreamOfType(java.io.InputStream in, java.lang.Class<T> clazz)
YamlOperations
loadStreamOfType
in interface YamlOperations
T
- 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 YamlOperations
T
- 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)
YamlOperations
loadStreamOfType
in interface YamlOperations
T
- the specified typeyamlText
- the text to read fromclazz
- the class of the specified type
public void dump(java.lang.Object obj, java.io.File file) throws java.io.FileNotFoundException
YamlOperations
dump
in interface YamlOperations
obj
- 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 YamlOperations
obj
- 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 YamlOperations
iterator
- 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 YamlOperations
iterator
- the iterator to read objects fromfile
- the file to write to
java.io.FileNotFoundException
public java.lang.String dump(java.lang.Object obj)
YamlOperations
dump
in interface YamlOperations
obj
- the object to dump
public java.lang.String dump(java.lang.Object obj, boolean minimalOutput)
YamlOperations
dump
in interface YamlOperations
obj
- the object to dumpminimalOutput
- whether minimal output is on
public java.lang.String dumpStream(java.util.Iterator iterator)
YamlOperations
dumpStream
in interface YamlOperations
iterator
- the iterator to read objects from
public java.lang.String dumpStream(java.util.Iterator iterator, boolean minimalOutput)
YamlOperations
dumpStream
in interface YamlOperations
iterator
- the iterator to read objects fromminimalOutput
- whether minimal output is on
public java.util.Map<java.lang.String,java.lang.String> getDecodingAccessScope()
public void setDecodingAccessScope(java.util.Map<java.lang.String,java.lang.String> decodingAccessScope)
public java.util.Map<java.lang.String,java.lang.String> getEncodingAccessScope()
public void setEncodingAccessScope(java.util.Map<java.lang.String,java.lang.String> encodingAccessScope)
public boolean isFieldAccessibleForDecoding(java.lang.reflect.Field field)
public boolean isFieldAccessibleForEncoding(java.lang.reflect.Field field)
public boolean isConstructorAccessibleForDecoding(java.lang.Class clazz)
public boolean isPropertyAccessibleForDecoding(java.beans.PropertyDescriptor prop)
public boolean isPropertyAccessibleForEncoding(java.beans.PropertyDescriptor prop)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |