Package jodd.csselly.selector
Enum Match
- java.lang.Object
-
- java.lang.Enum<Match>
-
- jodd.csselly.selector.Match
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DASHRepresents an element with the att attribute, its value either being exactly "val" or beginning with "val" immediately followed by "-"EQUALSRepresents an element with the att attribute whose value is exactly "val".INCLUDESRepresents an element with the att attribute whose value is a whitespace-separated list of words, one of which is exactly "val".PREFIXRepresents an element with the att attribute whose value begins with the prefix "val".SUBSTRINGRepresents an element with the att attribute whose value contains at least one instance of the substring "val".SUFFIXRepresents an element with the att attribute whose value ends with the suffix "val".
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleancompare(java.lang.String attr, java.lang.String val)Compares attr and val values.java.lang.StringgetSign()Returns match sign.static MatchvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static MatchvalueOfFirstChar(char firstChar)Resolves match type from the first character of the sign.static MatchvalueOfSign(java.lang.String sign)Resolves match type from the sign.static Match[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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.
-
-
Method Detail
-
values
public static Match[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Match c : Match.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Match valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getSign
public java.lang.String getSign()
Returns match sign.
-
compare
public abstract boolean compare(java.lang.String attr, java.lang.String val)Compares attr and val values.
-
valueOfSign
public static Match valueOfSign(java.lang.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 '='.
-
-