|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.yaml.snakeyaml.Yaml
public class Yaml
Public YAML interface. Each Thread must have its own instance.
Field Summary | |
---|---|
protected BaseConstructor |
constructor
|
protected DumperOptions |
dumperOptions
|
protected LoaderOptions |
loaderOptions
|
protected Representer |
representer
|
protected Resolver |
resolver
|
Constructor Summary | |
---|---|
Yaml()
Create Yaml instance. |
|
Yaml(BaseConstructor constructor)
Create Yaml instance. |
|
Yaml(BaseConstructor constructor,
LoaderOptions loaderOptions,
Representer representer,
DumperOptions dumperOptions,
Resolver resolver)
Create Yaml instance. |
|
Yaml(BaseConstructor constructor,
Representer representer)
Create Yaml instance. |
|
Yaml(BaseConstructor constructor,
Representer representer,
DumperOptions dumperOptions)
Create Yaml instance. |
|
Yaml(BaseConstructor constructor,
Representer representer,
DumperOptions dumperOptions,
Resolver resolver)
Create Yaml instance. |
|
Yaml(Dumper dumper)
Create Yaml instance. |
|
Yaml(DumperOptions dumperOptions)
Create Yaml instance. |
|
Yaml(Loader loader)
Deprecated. use with Constructor instead of Loader |
|
Yaml(Loader loader,
Dumper dumper)
Deprecated. use with Constructor instead of Loader |
|
Yaml(Loader loader,
Dumper dumper,
Resolver resolver)
Deprecated. use with Constructor instead of Loader |
|
Yaml(LoaderOptions loaderOptions)
|
|
Yaml(Representer representer)
Create Yaml instance. |
|
Yaml(Representer representer,
DumperOptions dumperOptions)
Create Yaml instance. |
Method Summary | |
---|---|
void |
addImplicitResolver(java.lang.String tag,
java.util.regex.Pattern regexp,
java.lang.String first)
Deprecated. use Tag instead of String |
void |
addImplicitResolver(Tag tag,
java.util.regex.Pattern regexp,
java.lang.String first)
Add an implicit scalar detector. |
Node |
compose(java.io.Reader yaml)
Parse the first YAML document in a stream and produce the corresponding representation tree. |
java.lang.Iterable<Node> |
composeAll(java.io.Reader yaml)
Parse all YAML documents in a stream and produce corresponding representation trees. |
java.lang.String |
dump(java.lang.Object data)
Serialize a Java object into a YAML String. |
void |
dump(java.lang.Object data,
java.io.Writer output)
Serialize a Java object into a YAML stream. |
java.lang.String |
dumpAll(java.util.Iterator<? extends java.lang.Object> data)
Serialize a sequence of Java objects into a YAML String. |
void |
dumpAll(java.util.Iterator<? extends java.lang.Object> data,
java.io.Writer output)
Serialize a sequence of Java objects into a YAML stream. |
java.lang.String |
getName()
Get a meaningful name. |
java.lang.Object |
load(java.io.InputStream io)
Parse the only YAML document in a stream and produce the corresponding Java object. |
java.lang.Object |
load(java.io.Reader io)
Parse the only YAML document in a stream and produce the corresponding Java object. |
java.lang.Object |
load(java.lang.String yaml)
Parse the only YAML document in a String and produce the corresponding Java object. |
java.lang.Iterable<java.lang.Object> |
loadAll(java.io.InputStream yaml)
Parse all YAML documents in a stream and produce corresponding Java objects. |
java.lang.Iterable<java.lang.Object> |
loadAll(java.io.Reader yaml)
Parse all YAML documents in a String and produce corresponding Java objects. |
java.lang.Iterable<java.lang.Object> |
loadAll(java.lang.String yaml)
Parse all YAML documents in a String and produce corresponding Java objects. |
java.lang.Iterable<Event> |
parse(java.io.Reader yaml)
Parse a YAML stream and produce parsing events. |
void |
setBeanAccess(BeanAccess beanAccess)
|
void |
setName(java.lang.String name)
Set a meaningful name to be shown in toString() |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Resolver resolver
protected BaseConstructor constructor
protected Representer representer
protected DumperOptions dumperOptions
protected LoaderOptions loaderOptions
Constructor Detail |
---|
public Yaml()
public Yaml(LoaderOptions loaderOptions)
public Yaml(DumperOptions dumperOptions)
dumperOptions
- DumperOptions to configure outgoing objectspublic Yaml(Representer representer)
representer
- Representer to emit outgoing objectspublic Yaml(BaseConstructor constructor)
constructor
- BaseConstructor to construct incoming documentspublic Yaml(BaseConstructor constructor, Representer representer)
constructor
- BaseConstructor to construct incoming documentsrepresenter
- Representer to emit outgoing objectspublic Yaml(Representer representer, DumperOptions dumperOptions)
representer
- Representer to emit outgoing objectsdumperOptions
- DumperOptions to configure outgoing objectspublic Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions)
constructor
- BaseConstructor to construct incoming documentsrepresenter
- Representer to emit outgoing objectsdumperOptions
- DumperOptions to configure outgoing objectspublic Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions, Resolver resolver)
constructor
- BaseConstructor to construct incoming documentsrepresenter
- Representer to emit outgoing objectsdumperOptions
- DumperOptions to configure outgoing objectsresolver
- Resolver to detect implicit typepublic Yaml(BaseConstructor constructor, LoaderOptions loaderOptions, Representer representer, DumperOptions dumperOptions, Resolver resolver)
constructor
- BaseConstructor to construct incoming documentsloaderOptions
- LoaderOptions to control construction processrepresenter
- Representer to emit outgoing objectsdumperOptions
- DumperOptions to configure outgoing objectsresolver
- Resolver to detect implicit typepublic Yaml(Loader loader)
public Yaml(Loader loader, Dumper dumper)
public Yaml(Loader loader, Dumper dumper, Resolver resolver)
public Yaml(Dumper dumper)
dumper
- Dumper to emit outgoing objectsMethod Detail |
---|
public java.lang.String dump(java.lang.Object data)
data
- Java object to be Serialized to YAML
public java.lang.String dumpAll(java.util.Iterator<? extends java.lang.Object> data)
data
- Iterator with Objects
public void dump(java.lang.Object data, java.io.Writer output)
data
- Java object to be Serialized to YAMLoutput
- stream to write topublic void dumpAll(java.util.Iterator<? extends java.lang.Object> data, java.io.Writer output)
data
- Iterator with Objectsoutput
- stream to write topublic java.lang.Object load(java.lang.String yaml)
yaml
- YAML data to load from (BOM must not be present)
public java.lang.Object load(java.io.InputStream io)
io
- data to load from (BOM is respected and removed)
public java.lang.Object load(java.io.Reader io)
io
- data to load from (BOM must not be present)
public java.lang.Iterable<java.lang.Object> loadAll(java.io.Reader yaml)
yaml
- YAML data to load from (BOM must not be present)
public java.lang.Iterable<java.lang.Object> loadAll(java.lang.String yaml)
yaml
- YAML data to load from (BOM must not be present)
public java.lang.Iterable<java.lang.Object> loadAll(java.io.InputStream yaml)
yaml
- YAML data to load from (BOM is respected and ignored)
public Node compose(java.io.Reader yaml)
yaml
- YAML document
public java.lang.Iterable<Node> composeAll(java.io.Reader yaml)
yaml
- stream of YAML documents
public void addImplicitResolver(java.lang.String tag, java.util.regex.Pattern regexp, java.lang.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 void addImplicitResolver(Tag tag, java.util.regex.Pattern regexp, java.lang.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 java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
public void setName(java.lang.String name)
name
- human readable namepublic java.lang.Iterable<Event> parse(java.io.Reader yaml)
yaml
- YAML document(s)
public void setBeanAccess(BeanAccess beanAccess)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |