Class ParsedAttrSpec


  • public class ParsedAttrSpec
    extends Object
    This wrapper class provides access to an AttrSpec and an attribute id which is unique within its context (e.g., it's unique within the ParsedTagSpec).
    Author:
    nhant01, GeorgeLuo
    • Constructor Detail

      • ParsedAttrSpec

        public ParsedAttrSpec​(@Nonnull
                              dev.amp.validator.ValidatorProtos.AttrSpec attrSpec,
                              String attrName)
        Constructor.
        Parameters:
        attrSpec - the AttrSpec.
        attrName - attr name.
    • Method Detail

      • getAttrName

        public String getAttrName()
        Returns unique name for this attr spec.
        Returns:
        returns unique name for this attr spec.
      • getSpec

        public dev.amp.validator.ValidatorProtos.AttrSpec getSpec()
        Returns the AttrSpec.
        Returns:
        returns this AttrSpec.
      • getValueUrlSpec

        public ParsedUrlSpec getValueUrlSpec()
        Returns the ParsedUrlSpec.
        Returns:
        returns the ParsedUrlSpec.
      • getValuePropertiesOrNull

        public ParsedValueProperties getValuePropertiesOrNull()
        Returns the ParsedValueProperties.
        Returns:
        returns the ParsedValueProperties.
      • getCssDeclarationByName

        public Map<String,​dev.amp.validator.ValidatorProtos.CssDeclaration> getCssDeclarationByName()
        Returns the CssDeclaration map.
        Returns:
        returns the CssDeclaration map.
      • isUsedForTypeIdentifiers

        public boolean isUsedForTypeIdentifiers​(@Nonnull
                                                List<String> typeIdentifiers)
        Returns true if this AttrSpec should be used for the given type identifiers based on the AttrSpec's disabled_by or enabled_by fields.
        Parameters:
        typeIdentifiers - a list of type identifies.
        Returns:
        returns true if this AttrSpec should be used for the given type identifiers based on AttrSpec's disabled or enabled_by fields.
      • cleanup

        public void cleanup()
        Clean up reference, improve gc performance.