public class YamlReader extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
YamlReader.YamlReaderException |
| Constructor and Description |
|---|
YamlReader(Reader reader) |
YamlReader(Reader reader,
YamlConfig config) |
YamlReader(String yaml) |
YamlReader(String yaml,
YamlConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected Object |
createObject(Class type)
Returns a new object of the requested type.
|
YamlConfig |
getConfig() |
static void |
main(String[] args) |
Object |
read()
Reads the next YAML document and deserializes it into an object.
|
<T> T |
read(Class<T> type)
Reads an object of the specified type from YAML.
|
<T> T |
read(Class<T> type,
Class elementType)
Reads an array, Map, List, or Collection object of the specified type from YAML, using the specified element type.
|
protected Object |
readValue(Class type,
Class elementType,
Class defaultType)
Reads an object from the YAML.
|
public YamlReader(Reader reader)
public YamlReader(Reader reader, YamlConfig config)
public YamlReader(String yaml)
public YamlReader(String yaml, YamlConfig config)
public YamlConfig getConfig()
public void close()
throws IOException
IOExceptionpublic Object read() throws YamlException
ArrayList, HashMap, or String.YamlExceptionpublic <T> T read(Class<T> type) throws YamlException
type - The type of object to read. If null, behaves the same as {read().YamlExceptionpublic <T> T read(Class<T> type, Class elementType) throws YamlException
type - The type of object to read. If null, behaves the same as {read().YamlExceptionprotected Object readValue(Class type, Class elementType, Class defaultType) throws YamlException, Parser.ParserException, Tokenizer.TokenizerException
protected Object createObject(Class type) throws InvocationTargetException
InvocationTargetExceptionCopyright © 2013. All Rights Reserved.