|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.yaml.snakeyaml.Yaml
public class Yaml
Public YAML interface. Each Thread must have its own instance.
Constructor Summary | |
---|---|
Yaml()
|
|
Yaml(Dumper dumper)
|
|
Yaml(DumperOptions options)
|
|
Yaml(Loader loader)
|
|
Yaml(Loader loader,
Dumper dumper)
Create Yaml instance. |
|
Yaml(Loader loader,
Dumper dumper,
Resolver resolver)
Create Yaml instance. |
Method Summary | |
---|---|
void |
addImplicitResolver(String tag,
Pattern regexp,
String first)
Add an implicit scalar detector. |
Node |
compose(Reader io)
Parse the first YAML document in a stream and produce the corresponding representation tree. |
Iterable<Node> |
composeAll(Reader io)
Parse all YAML documents in a stream and produce corresponding representation trees. |
String |
dump(Object data)
Serialize a Java object into a YAML String. |
void |
dump(Object data,
Writer output)
Serialize a Java object into a YAML stream. |
String |
dumpAll(Iterator<? extends Object> data)
Serialize a sequence of Java objects into a YAML String. |
void |
dumpAll(Iterator<? extends Object> data,
Writer output)
Serialize a sequence of Java objects into a YAML stream. |
String |
getName()
Get a meaningful name. |
Object |
load(InputStream io)
Parse the first YAML document in a stream and produce the corresponding Java object. |
Object |
load(Reader io)
Parse the first YAML document in a stream and produce the corresponding Java object. |
Object |
load(String yaml)
Parse the first YAML document in a String and produce the corresponding Java object. |
Iterable<Object> |
loadAll(InputStream yaml)
Parse all YAML documents in a stream and produce corresponding Java objects. |
Iterable<Object> |
loadAll(Reader yaml)
Parse all YAML documents in a String and produce corresponding Java objects. |
Iterable<Object> |
loadAll(String yaml)
Parse all YAML documents in a String and produce corresponding Java objects. |
Iterable<Event> |
parse(Reader yaml)
Parse a YAML stream and produce parsing events. |
void |
setName(String name)
Set a meaningful name to be shown in toString() |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Yaml(DumperOptions options)
public Yaml(Dumper dumper)
public Yaml(Loader loader)
public Yaml(Loader loader, Dumper dumper)
loader
- Loader to parse incoming documentsdumper
- Dumper to emit outgoing objectspublic Yaml(Loader loader, Dumper dumper, Resolver resolver)
loader
- Loader to parse incoming documentsdumper
- Dumper to emit outgoing objectsresolver
- Resolver to detect implicit typepublic Yaml()
Method Detail |
---|
public String dump(Object data)
data
- Java object to be Serialized to YAML
public String dumpAll(Iterator<? extends Object> data)
data
- Iterator with Objects
public void dump(Object data, Writer output)
data
- Java object to be Serialized to YAMLoutput
- stream to write topublic void dumpAll(Iterator<? extends Object> data, Writer output)
data
- Iterator with Objectsoutput
- stream to write topublic Object load(String yaml)
yaml
- YAML data to load from (BOM must not be present)
public Object load(InputStream io)
io
- data to load from (BOM is respected and removed)
public Object load(Reader io)
io
- data to load from (BOM must not be present)
public Iterable<Object> loadAll(Reader yaml)
yaml
- YAML data to load from (BOM must not be present)
public Iterable<Object> loadAll(String yaml)
yaml
- YAML data to load from (BOM must not be present)
public Iterable<Object> loadAll(InputStream yaml)
yaml
- YAML data to load from (BOM is respected and ignored)
public Node compose(Reader io)
io
- stream of a YAML document
public Iterable<Node> composeAll(Reader io)
io
- stream of YAML documents
public void addImplicitResolver(String tag, Pattern regexp, String first)
tag
- tag to assign to the noderegexp
- regular expression to match againstfirst
- a sequence of possible initial characters or null (which means
any).public String toString()
toString
in class Object
public String getName()
public void setName(String name)
name
- human readable namepublic Iterable<Event> parse(Reader yaml)
yaml
- YAML document(s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |