Class CssAttributeSelectorItem

java.lang.Object
com.itextpdf.styledxmlparser.css.selector.item.CssAttributeSelectorItem
All Implemented Interfaces:
ICssSelectorItem

public class CssAttributeSelectorItem extends Object implements ICssSelectorItem
ICssSelectorItem implementation for attribute selectors.
  • Constructor Details

    • CssAttributeSelectorItem

      public CssAttributeSelectorItem (String attrSelector)
      Creates a new CssAttributeSelectorItem instance.
      Parameters:
      attrSelector - the attribute
  • Method Details

    • getSpecificity

      public int getSpecificity()
      Description copied from interface: ICssSelectorItem
      Gets the specificity.
      Specified by:
      getSpecificity in interface ICssSelectorItem
      Returns:
      the specificity
    • matches

      public boolean matches (INode node)
      Description copied from interface: ICssSelectorItem
      Checks if the selector matches an element.
      Specified by:
      matches in interface ICssSelectorItem
      Parameters:
      node - the element
      Returns:
      true, if there's a match
    • escapeSpecialCharacters

      public static String escapeSpecialCharacters (String input)
      Escapes special characters determined by SPECIAL_CHARACTERS in provided String in order to be used as literal value in a pattern. Note that special characters contain white space and '#' characters to match dotnet special characters. Java allows to escape such (but not all) non-special characters and treats them as literal characters.
      Parameters:
      input - String to escape special characters in
      Returns:
      string with special characters escaped
    • toString

      public String toString()
      Overrides:
      toString in class Object