Class ExistsMatchSelector


public class ExistsMatchSelector extends AbstractAttributeSelector
An "exists match" matches an element if the element has an attribute with the specified name.
Author:
Werner Randelshofer
  • Constructor Details

    • ExistsMatchSelector

      public ExistsMatchSelector(@Nullable SourceLocator sourceLocator, @Nullable String namespacePattern, String attributeName)
      Creates a new instance.
      Parameters:
      sourceLocator - source locator for debugging
      namespacePattern - an optional namespace ("*" means any namespace, null means no namespace)
      attributeName - the attribute name
  • Method Details

    • match

      protected <T> @Nullable T match(SelectorModel<T> model, T element)
      Description copied from class: Selector
      Returns the matching element.
      Specified by:
      match in class Selector
      Type Parameters:
      T - element type
      Parameters:
      model - The helper is used to access properties of the element and parent or sibling elements in the document.
      element - the element
      Returns:
      the matching element or null
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • produceTokens

      public void produceTokens(Consumer<CssToken> consumer)
      Description copied from class: AbstractSyntaxTree
      Produces tokens for the subtree starting at this tree node.
      Overrides:
      produceTokens in class AbstractSyntaxTree
      Parameters:
      consumer - a consumer for the tokens
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object