Class Resolver

java.lang.Object
org.yaml.snakeyaml.resolver.Resolver

public class Resolver extends Object
Resolver tries to detect a type by content (when the tag is implicit)
  • Field Details

    • BOOL

      public static final Pattern BOOL
    • FLOAT

      public static final Pattern FLOAT
      The regular expression is taken from the 1.2 specification but '_'s are added to keep backwards compatibility
    • INT

      public static final Pattern INT
    • MERGE

      public static final Pattern MERGE
    • NULL

      public static final Pattern NULL
    • EMPTY

      public static final Pattern EMPTY
    • TIMESTAMP

      public static final Pattern TIMESTAMP
    • VALUE

      public static final Pattern VALUE
    • YAML

      public static final Pattern YAML
    • yamlImplicitResolvers

      protected Map<Character,List<ResolverTuple>> yamlImplicitResolvers
  • Constructor Details

    • Resolver

      public Resolver()
  • Method Details

    • addImplicitResolvers

      protected void addImplicitResolvers()
    • addImplicitResolver

      public void addImplicitResolver(Tag tag, Pattern regexp, String first)
    • addImplicitResolver

      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 - - the Tag to assign when the value matches
      regexp - - the RE which is applied for every value
      first - - the possible first characters (this is merely for performance improvement) to skip RE evaluation to gain time
      limit - - 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
    • resolve

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