jodd.lagarto.csselly.selector
Enum Match

java.lang.Object
  extended by java.lang.Enum<Match>
      extended by jodd.lagarto.csselly.selector.Match
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Match>

public enum Match
extends java.lang.Enum<Match>

Attribute relation matcher.


Enum Constant Summary
DASH
          Represents an element with the att attribute, its value either being exactly "val" or beginning with "val" immediately followed by "-"
EQUALS
          Represents an element with the att attribute whose value is exactly "val".
INCLUDES
          Represents an element with the att attribute whose value is a whitespace-separated list of words, one of which is exactly "val".
PREFIX
          Represents an element with the att attribute whose value begins with the prefix "val".
SUBSTRING
          Represents an element with the att attribute whose value contains at least one instance of the substring "val".
SUFFIX
          Represents an element with the att attribute whose value ends with the suffix "val".
 
Method Summary
abstract  boolean compare(java.lang.String attr, java.lang.String val)
          Compares attr and val values.
 java.lang.String getSign()
          Returns match sign.
static Match valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Match valueOfFirstChar(char firstChar)
          Resolves match type from the first character of the sign.
static Match valueOfSign(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're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

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 final Match[] values()
Returns an array containing the constants of this enum type, in the order they're 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're 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 name

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 '='.



Copyright © 2003-2012 Jodd Team