Top Description Fields Constructors Methods
org.yaml.snakeyaml.resolver

public Class Resolver

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashMap, .List, .Map, java.util.regex.Pattern, org.yaml.snakeyaml.nodes.NodeId, .Tag

Resolver tries to detect a type by content (when the tag is implicit)

Field Summary

Modifier and TypeField and Description
public static final Pattern
public static final Pattern
public static final Pattern
FLOAT

The regular expression is taken from the 1.2 specification but '_'s are added to keep backwards compatibility

public static final Pattern
public static final Pattern
public static final Pattern
public static final Pattern
public static final Pattern
public static final Pattern
protected Map<Character, List<ResolverTuple>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addImplicitResolver(Tag tag, Pattern regexp, String first)

public void
addImplicitResolver(Tag
- the Tag to assign when the value matches
tag
,
Pattern
- the RE which is applied for every value
regexp
,
String
- the possible first characters (this is merely for performance improvement) to skip RE evaluation to gain time
first
,
int
- the limit of the value to analyze. The limit is here only to fight the DoS attack when huge values are provided, and it may lead to slow pattern evaluation
limit
)

Add a resolver to resolve a value that matches the provided regular expression to the provided tag

protected void
public Tag
resolve(NodeId kind, String value, boolean implicit)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BOOLback to summary
public static final Pattern BOOL
EMPTYback to summary
public static final Pattern EMPTY
FLOATback to summary
public static final Pattern FLOAT

The regular expression is taken from the 1.2 specification but '_'s are added to keep backwards compatibility

INTback to summary
public static final Pattern INT
MERGEback to summary
public static final Pattern MERGE
NULLback to summary
public static final Pattern NULL
TIMESTAMPback to summary
public static final Pattern TIMESTAMP
VALUEback to summary
public static final Pattern VALUE
YAMLback to summary
public static final Pattern YAML
yamlImplicitResolversback to summary
protected Map<Character, List<ResolverTuple>> yamlImplicitResolvers

Constructor Detail

Resolverback to summary
public Resolver()

Method Detail

addImplicitResolverback to summary
public void addImplicitResolver(Tag tag, Pattern regexp, String first)
addImplicitResolverback to summary
public void addImplicitResolver(Tag tag, Pattern regexp, String first, int limit)

Add a resolver to resolve a value that matches the provided regular expression to the provided tag

Parameters
tag:Tag

- the Tag to assign when the value matches

regexp:Pattern

- the RE which is applied for every value

first:String

- the possible first characters (this is merely for performance improvement) to skip RE evaluation to gain time

limit:int

- the limit of the value to analyze. The limit is here only to fight the DoS attack when huge values are provided, and it may lead to slow pattern evaluation

addImplicitResolversback to summary
protected void addImplicitResolvers()
resolveback to summary
public Tag resolve(NodeId kind, String value, boolean implicit)