Package dev.amp.validator
Class ParsedAttrSpecs
- java.lang.Object
-
- dev.amp.validator.ParsedAttrSpecs
-
public class ParsedAttrSpecs extends Object
TagSpecs specify attributes that are valid for a particular tag. They can also reference lists of attributes (AttrLists), thereby sharing those definitions. This abstraction instantiates ParsedAttrSpec for each AttrSpec (from validator-*.protoascii, our specification file) exactly once, and provides quick access to the attr spec names as well, including for simple attr specs (those which only have a name but no specification for their value).- Author:
- nhant01, GeorgeLuo
-
-
Constructor Summary
Constructors Constructor Description ParsedAttrSpecs(AMPValidatorManager validatorManager)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()Clean up reference, improve gc performance.List<dev.amp.validator.ValidatorProtos.AttrSpec>getAmpLayoutAttrs()Returns the AmpLayout attr list.List<dev.amp.validator.ValidatorProtos.AttrSpec>getAttrListByName(String name)Returns the attr list by name.List<dev.amp.validator.ValidatorProtos.AttrSpec>getGlobalAttrs()Returns the global attr list.ParsedAttrSpecgetParsedAttrSpec(String tagName, String attrName, String value, dev.amp.validator.ValidatorProtos.AttrSpec attrSpec)Returns the ParsedAttrSpec.
-
-
-
Constructor Detail
-
ParsedAttrSpecs
public ParsedAttrSpecs(@Nonnull AMPValidatorManager validatorManager)Constructor.- Parameters:
validatorManager- the AMPValidatorManager instance.
-
-
Method Detail
-
getParsedAttrSpec
public ParsedAttrSpec getParsedAttrSpec(@Nonnull String tagName, @Nonnull String attrName, @Nonnull String value, @Nonnull dev.amp.validator.ValidatorProtos.AttrSpec attrSpec)
Returns the ParsedAttrSpec.- Parameters:
tagName- the tag spec name.attrName- the attr spec name.value- the attr spec value.attrSpec- the AttributeSpec.- Returns:
- returns the ParsedAttrSpec.
-
getAttrListByName
public List<dev.amp.validator.ValidatorProtos.AttrSpec> getAttrListByName(@Nonnull String name)
Returns the attr list by name.- Parameters:
name- the attr list name.- Returns:
- returns the attr list.
-
getGlobalAttrs
public List<dev.amp.validator.ValidatorProtos.AttrSpec> getGlobalAttrs()
Returns the global attr list.- Returns:
- returns the global attr list.
-
getAmpLayoutAttrs
public List<dev.amp.validator.ValidatorProtos.AttrSpec> getAmpLayoutAttrs()
Returns the AmpLayout attr list.- Returns:
- returns the AmpLayout attr list.
-
cleanup
public void cleanup()
Clean up reference, improve gc performance.
-
-