Class ChildTagMatcher


  • public class ChildTagMatcher
    extends Object
    The child tag matcher evaluates ChildTagSpec. The constructor provides the enclosing TagSpec for the parent tag so that we can produce error messages mentioning the parent.
    Author:
    nhant01, GeorgeLuo
    • Constructor Detail

      • ChildTagMatcher

        public ChildTagMatcher​(@Nonnull
                               dev.amp.validator.ValidatorProtos.TagSpec parentSpec)
                        throws TagValidationException
        Constructor.
        Parameters:
        parentSpec - parent tag spec.
        Throws:
        TagValidationException - child tag expected to be null.
    • Method Detail

      • matchChildTagName

        public void matchChildTagName​(@Nonnull
                                      ParsedHtmlTag encounteredTag,
                                      @Nonnull
                                      Context context,
                                      @Nonnull
                                      dev.amp.validator.ValidatorProtos.ValidationResult.Builder result)
                               throws TagValidationException
        Matching child tag name.
        Parameters:
        encounteredTag - the ParsedHtmlTag.
        context - the Context.
        result - validation result.
        Throws:
        TagValidationException - the TagValidationException.
      • exitTag

        public void exitTag​(@Nonnull
                            Context context,
                            @Nonnull
                            dev.amp.validator.ValidatorProtos.ValidationResult.Builder result)
                     throws TagValidationException
        Exit tag.
        Parameters:
        context - the context.
        result - validation result.
        Throws:
        TagValidationException - the TagValidationException.