public class Yaml extends Object
Modifier and Type | Field and Description |
---|---|
protected BaseConstructor |
constructor |
protected DumperOptions |
dumperOptions |
protected LoaderOptions |
loaderOptions |
protected Representer |
representer |
protected Resolver |
resolver |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
addImplicitResolver(String tag,
Pattern regexp,
String first)
Deprecated.
use Tag instead of String
|
void |
addImplicitResolver(Tag tag,
Pattern regexp,
String first)
Add an implicit scalar detector.
|
Node |
compose(Reader yaml)
Parse the first YAML document in a stream and produce the corresponding
representation tree.
|
Iterable<Node> |
composeAll(Reader yaml)
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 only YAML document in a stream and produce the corresponding
Java object.
|
Object |
load(Reader io)
Parse the only YAML document in a stream and produce the corresponding
Java object.
|
Object |
load(String yaml)
Parse the only 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 |
setBeanAccess(BeanAccess beanAccess) |
void |
setName(String name)
Set a meaningful name to be shown in toString()
|
String |
toString() |
protected final Resolver resolver
protected BaseConstructor constructor
protected Representer representer
protected DumperOptions dumperOptions
protected LoaderOptions loaderOptions
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, Resolver resolver)
public Yaml(Dumper dumper)
dumper
- Dumper to emit outgoing objectspublic String dump(Object data)
data
- Java object to be Serialized to YAMLpublic String dumpAll(Iterator<? extends Object> data)
data
- Iterator with Objectspublic 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 yaml)
yaml
- YAML documentpublic Iterable<Node> composeAll(Reader yaml)
yaml
- stream of YAML documentspublic 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 void addImplicitResolver(Tag 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 getName()
public void setName(String name)
name
- human readable namepublic Iterable<Event> parse(Reader yaml)
yaml
- YAML document(s)public void setBeanAccess(BeanAccess beanAccess)
Copyright © 2008-2012. All Rights Reserved.