Class AttributeSpecifier

  • All Implemented Interfaces:
    Specifier

    class AttributeSpecifier
    extends java.lang.Object
    implements Specifier
    An implementation of Specifier for attributes.

    Note:
    This implementation will also be used for ID selectors and class selectors.

    See Also:
    Attribute selectors
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  AttributeSpecifier.Match
      The type of match to perform for the attribute.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private AttributeSpecifier.Match match
      The type of match to perform for the attribute.
      private java.lang.String name
      The name of the attribute.
      private java.lang.String value
      The attribute value.
    • Constructor Summary

      Constructors 
      Constructor Description
      AttributeSpecifier​(java.lang.String name)
      Create a new attribute specifier with the specified attribute name.
      AttributeSpecifier​(java.lang.String name, java.lang.String value, AttributeSpecifier.Match match)
      Create a new attribute specifier with the specified name, value and match type.
    • Field Detail

      • name

        private final java.lang.String name
        The name of the attribute.
      • value

        private final java.lang.String value
        The attribute value.
    • Constructor Detail

      • AttributeSpecifier

        public AttributeSpecifier​(java.lang.String name)
        Create a new attribute specifier with the specified attribute name.

        This attribute specifier is used to check if the attribute with the specified name exists whatever the value of the attribute.

        Parameters:
        name - The name of the attribute.
      • AttributeSpecifier

        public AttributeSpecifier​(java.lang.String name,
                                  java.lang.String value,
                                  AttributeSpecifier.Match match)
        Create a new attribute specifier with the specified name, value and match type.
        Parameters:
        name - The name of the attribute.
        value - The attribute value.
        match - The type of match to perform for the attribute.
    • Method Detail

      • getName

        public java.lang.String getName()
        Get the name of the attribute.
        Returns:
        The name of the attribute.
      • getValue

        public java.lang.String getValue()
        Get the attribute value.
        Returns:
        The attribute value or null.
      • getMatch

        public AttributeSpecifier.Match getMatch()
        Get the type of match to perform for the attribute.
        Returns:
        The type of match or null.