Package org.snakeyaml.engine.v2.resolver
Class BaseScalarResolver
- java.lang.Object
-
- org.snakeyaml.engine.v2.resolver.BaseScalarResolver
-
- All Implemented Interfaces:
ScalarResolver
- Direct Known Subclasses:
CoreScalarResolver,FailsafeScalarResolver,JsonScalarResolver
public abstract class BaseScalarResolver extends Object implements ScalarResolver
Base resolver
-
-
Field Summary
Fields Modifier and Type Field Description static PatternEMPTYNo value indicationstatic PatternENV_FORMATgroup 1: name, group 2: separator, group 3: valueprotected Map<Character,List<org.snakeyaml.engine.v2.resolver.ResolverTuple>>yamlImplicitResolversMap from the char to the resolver which may begin with this char
-
Constructor Summary
Constructors Constructor Description BaseScalarResolver()Create
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddImplicitResolver(org.snakeyaml.engine.v2.nodes.Tag tag, Pattern regexp, String first)Add a resolver to resolve a value that matches the provided regular expression to the provided tagorg.snakeyaml.engine.v2.nodes.Tagresolve(String value, Boolean implicit)Resolve (detect) the tag of the scalar node of the given type.
-
-
-
Method Detail
-
addImplicitResolver
public void addImplicitResolver(org.snakeyaml.engine.v2.nodes.Tag tag, Pattern regexp, String first)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 time
-
resolve
public org.snakeyaml.engine.v2.nodes.Tag resolve(String value, Boolean implicit)
Description copied from interface:ScalarResolverResolve (detect) the tag of the scalar node of the given type.- Specified by:
resolvein interfaceScalarResolver- Parameters:
value- - the value of the scalar nodeimplicit- - true if there was no tag specified (the tag will be resolved)- Returns:
- the Tag that matches the contents
-
-