Package org.yaml.snakeyaml.resolver
Class Resolver
- java.lang.Object
-
- org.yaml.snakeyaml.resolver.Resolver
-
public class Resolver extends java.lang.Object
Resolver tries to detect a type by content (when the tag is implicit)
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.Pattern
BOOL
static java.util.regex.Pattern
EMPTY
static java.util.regex.Pattern
FLOAT
The regular expression is taken from the 1.2 specification but '_'s are added to keep backwards compatibilitystatic java.util.regex.Pattern
INT
static java.util.regex.Pattern
MERGE
static java.util.regex.Pattern
NULL
static java.util.regex.Pattern
TIMESTAMP
static java.util.regex.Pattern
VALUE
static java.util.regex.Pattern
YAML
protected java.util.Map<java.lang.Character,java.util.List<org.yaml.snakeyaml.resolver.ResolverTuple>>
yamlImplicitResolvers
-
Constructor Summary
Constructors Constructor Description Resolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addImplicitResolver(Tag tag, java.util.regex.Pattern regexp, java.lang.String first)
void
addImplicitResolver(Tag tag, java.util.regex.Pattern regexp, java.lang.String first, int limit)
Add a resolver to resolve a value that matches the provided regular expression to the provided tagprotected void
addImplicitResolvers()
Tag
resolve(NodeId kind, java.lang.String value, boolean implicit)
-
-
-
Field Detail
-
BOOL
public static final java.util.regex.Pattern BOOL
-
FLOAT
public static final java.util.regex.Pattern FLOAT
The regular expression is taken from the 1.2 specification but '_'s are added to keep backwards compatibility
-
INT
public static final java.util.regex.Pattern INT
-
MERGE
public static final java.util.regex.Pattern MERGE
-
NULL
public static final java.util.regex.Pattern NULL
-
EMPTY
public static final java.util.regex.Pattern EMPTY
-
TIMESTAMP
public static final java.util.regex.Pattern TIMESTAMP
-
VALUE
public static final java.util.regex.Pattern VALUE
-
YAML
public static final java.util.regex.Pattern YAML
-
yamlImplicitResolvers
protected java.util.Map<java.lang.Character,java.util.List<org.yaml.snakeyaml.resolver.ResolverTuple>> yamlImplicitResolvers
-
-
Method Detail
-
addImplicitResolvers
protected void addImplicitResolvers()
-
addImplicitResolver
public void addImplicitResolver(Tag tag, java.util.regex.Pattern regexp, java.lang.String first)
-
addImplicitResolver
public void addImplicitResolver(Tag tag, java.util.regex.Pattern regexp, java.lang.String first, int limit)
Add a resolver to resolve a value that matches the provided regular expression to the provided tag- Parameters:
tag
- - the Tag to assign when the value matchesregexp
- - the RE which is applied for every valuefirst
- - the possible first characters (this is merely for performance improvement) to skip RE evaluation to gain timelimit
- - 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
-
-