Class BaseScalarResolver

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.regex.Pattern EMPTY
      No value indication
      static java.util.regex.Pattern ENV_FORMAT
      group 1: name, group 2: separator, group 3: value
      protected java.util.Map<java.lang.Character,​java.util.List<ResolverTuple>> yamlImplicitResolvers
      Map from the char to the resolver which may begin with this char
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addImplicitResolver​(Tag tag, java.util.regex.Pattern regexp, java.lang.String first)
      Add a resolver to resolve a value that matches the provided regular expression to the provided tag
      (package private) abstract void addImplicitResolvers()
      Register all the resolvers to be applied
      Tag resolve​(java.lang.String value, java.lang.Boolean implicit)
      Resolve (detect) the tag of the scalar node of the given type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EMPTY

        public static final java.util.regex.Pattern EMPTY
        No value indication
      • ENV_FORMAT

        public static final java.util.regex.Pattern ENV_FORMAT
        group 1: name, group 2: separator, group 3: value
      • yamlImplicitResolvers

        protected java.util.Map<java.lang.Character,​java.util.List<ResolverTuple>> yamlImplicitResolvers
        Map from the char to the resolver which may begin with this char
    • Constructor Detail

      • BaseScalarResolver

        public BaseScalarResolver()
        Create
    • Method Detail

      • addImplicitResolver

        public void addImplicitResolver​(Tag tag,
                                        java.util.regex.Pattern regexp,
                                        java.lang.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 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
      • addImplicitResolvers

        abstract void addImplicitResolvers()
        Register all the resolvers to be applied
      • resolve

        public Tag resolve​(java.lang.String value,
                           java.lang.Boolean implicit)
        Description copied from interface: ScalarResolver
        Resolve (detect) the tag of the scalar node of the given type.
        Specified by:
        resolve in interface ScalarResolver
        Parameters:
        value - - the value of the scalar node
        implicit - - true if there was no tag specified (the tag will be resolved)
        Returns:
        the Tag that matches the contents