Enum Class Match

java.lang.Object
java.lang.Enum<Match>
jodd.csselly.selector.Match
All Implemented Interfaces:
Serializable, Comparable<Match>, Constable

public enum Match extends Enum<Match>
Attribute relation matcher.
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Represents an element with the att attribute, its value either being exactly "val" or beginning with "val" immediately followed by "-"
    Represents an element with the att attribute whose value is exactly "val".
    Represents an element with the att attribute whose value is a whitespace-separated list of words, one of which is exactly "val".
    Represents an element with the att attribute whose value begins with the prefix "val".
    Represents an element with the att attribute whose value contains at least one instance of the substring "val".
    Represents an element with the att attribute whose value ends with the suffix "val".
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Match(String sign)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract boolean
    compare(String attr, String val)
    Compares attr and val values.
    Returns match sign.
    static Match
    Returns the enum constant of this class with the specified name.
    static Match
    valueOfFirstChar(char firstChar)
    Resolves match type from the first character of the sign.
    static Match
    Resolves match type from the sign.
    static Match[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • EQUALS

      public static final Match EQUALS
      Represents an element with the att attribute whose value is exactly "val".
    • INCLUDES

      public static final Match INCLUDES
      Represents an element with the att attribute whose value is a whitespace-separated list of words, one of which is exactly "val". If "val" contains whitespace, it will never represent anything (since the words are separated by spaces). Also if "val" is the empty string, it will never represent anything.
    • DASH

      public static final Match DASH
      Represents an element with the att attribute, its value either being exactly "val" or beginning with "val" immediately followed by "-"
    • PREFIX

      public static final Match PREFIX
      Represents an element with the att attribute whose value begins with the prefix "val". If "val" is the empty string then the selector does not represent anything.
    • SUFFIX

      public static final Match SUFFIX
      Represents an element with the att attribute whose value ends with the suffix "val". If "val" is the empty string then the selector does not represent anything.
    • SUBSTRING

      public static final Match SUBSTRING
      Represents an element with the att attribute whose value contains at least one instance of the substring "val". If "val" is the empty string then the selector does not represent anything.
  • Field Details

    • sign

      private final String sign
  • Constructor Details

    • Match

      private Match(String sign)
  • Method Details

    • values

      public static Match[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Match valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getSign

      public String getSign()
      Returns match sign.
    • compare

      public abstract boolean compare(String attr, String val)
      Compares attr and val values.
    • valueOfSign

      public static Match valueOfSign(String sign)
      Resolves match type from the sign.
    • valueOfFirstChar

      public static Match valueOfFirstChar(char firstChar)
      Resolves match type from the first character of the sign. It is assumed that the second character is '='.