java.lang.Object
dev.prozilla.pine.common.property.style.selector.Selector
All Implemented Interfaces:
Printable
Direct Known Subclasses:
ClassSelector, IdSelector, ModifierSelector, NotSelector, SelectorCombo, TypeSelector

public abstract class Selector extends Object implements Printable
A selector for nodes based on CSS selectors.
  • Field Details

    • UNIVERSAL

      public static final Selector UNIVERSAL
      Matches all elements.
  • Constructor Details

    • Selector

      public Selector()
  • Method Details

    • matches

      public abstract boolean matches(Node node)
      Checks whether this selector matches a given node.
      Parameters:
      node - The node
      Returns:
      True if this selector matches the node.
    • getSpecificity

      public abstract int getSpecificity()
      Returns an integer representing the specificity of this selector.
      Returns:
      The specificity of this selector
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • equals

      public abstract boolean equals(Selector other)
    • parse

      public static Selector parse(String input)