Package dev.amp.validator
Class ChildTagMatcher
- java.lang.Object
-
- dev.amp.validator.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 Summary
Constructors Constructor Description ChildTagMatcher(dev.amp.validator.ValidatorProtos.TagSpec parentSpec)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexitTag(Context context, dev.amp.validator.ValidatorProtos.ValidationResult.Builder result)Exit tag.voidmatchChildTagName(ParsedHtmlTag encounteredTag, Context context, dev.amp.validator.ValidatorProtos.ValidationResult.Builder result)Matching child tag name.
-
-
-
Constructor Detail
-
ChildTagMatcher
public ChildTagMatcher(@Nonnull dev.amp.validator.ValidatorProtos.TagSpec parentSpec) throws TagValidationExceptionConstructor.- 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 TagValidationExceptionMatching 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 TagValidationExceptionExit tag.- Parameters:
context- the context.result- validation result.- Throws:
TagValidationException- the TagValidationException.
-
-