public class YamlObject<T> extends Object
Yaml is represented as atomic types (literals, expressions) and YamlObjects (for wrapping
lists and maps). The factory method create(Object)
will sort out the details. These
YamlObjects are used to stage data when parsing a Yaml document.
Modifier | Constructor and Description |
---|---|
protected |
YamlObject(T raw) |
Modifier and Type | Method and Description |
---|---|
protected <C> C |
convert(Object obj,
Class<C> clazz)
Converts an object to the specified class.
|
static <W> YamlObject<W> |
create(W raw)
Convert raw object to Yaml wrapper.
|
Object |
lookup(String path)
Raw value access via path.
|
Object |
lookupY(String path)
|
YamlMap |
map()
Casts this object to a
YamlMap . |
T |
raw()
Returns the raw object.
|
YamlSeq |
seq()
Casts this object to a
YamlSeq . |
String |
toString()
Yaml representation.
|
protected T raw
protected YamlObject(T raw)
public static <W> YamlObject<W> create(W raw)
Other data (Literals, Expressions) are considered atomic and do not provide a YamlObject representation.
raw
- public Object lookup(String path)
Indended for quick value lookup during test cases.
path
- public T raw()
public Object lookupY(String path)
lookup(java.lang.String)
. Ensures that the result is wrapped as a YamlObject if it is a map, list,
or array.path
- protected <C> C convert(Object obj, Class<C> clazz)
Copyright © 1996–2019 Geotools. All rights reserved.