org.weborganic.uri.template
Enum TokenOperatorD3.Operator

java.lang.Object
  extended by java.lang.Enum<TokenOperatorD3.Operator>
      extended by org.weborganic.uri.template.TokenOperatorD3.Operator
All Implemented Interfaces:
Serializable, Comparable<TokenOperatorD3.Operator>
Enclosing class:
TokenOperatorD3

public static enum TokenOperatorD3.Operator
extends Enum<TokenOperatorD3.Operator>

The list of operators currently supported.


Enum Constant Summary
JOIN
          4.4.6 The 'join' operator.
LIST
          4.4.7 The 'list' operator.
NEG
          4.4.3 The 'neg' operator.
OPT
          4.4.2 The 'opt' operator.
PREFIX
          4.4.4 The 'prefix' operator.
SUFFIX
          4.4.5 The 'suffix' operator.
 
Method Summary
static TokenOperatorD3.Operator valueOf(String name)
          Returns the enum constant of this type with the specified name.
static TokenOperatorD3.Operator[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

OPT

public static final TokenOperatorD3.Operator OPT
4.4.2 The 'opt' operator. If each variable is undefined or an empty list then substitute the empty string, otherwise substitute the value of 'arg'. Example:
 foo := "fred"
 
 "{-opt|fred@example.org|foo}" -> "fred@example.org"
 "{-opt|fred@example.org|bar}" -> ""
 


NEG

public static final TokenOperatorD3.Operator NEG
4.4.3 The 'neg' operator. If each variable is undefined or an empty list then substitute the value of arg, otherwise substitute the empty string. Example:
  foo := "fred"
 
 "{-neg|fred@example.org|foo}" -> ""
 "{-neg|fred@example.org|bar}" -> "fred@example.org"
 


PREFIX

public static final TokenOperatorD3.Operator PREFIX
4.4.4 The 'prefix' operator. The prefix operator MUST only have one variable in its expansion. More than one variable is an error condition. If the variable is undefined or an empty list then substitute the empty string. If the variable is a defined non-list then substitute the value of arg preceeded by the value of the variable. If the variable is a defined list then substitute the concatenation of every list value preceeded by the arg. Example:
  foo := "fred"
  bar := ["fee", "fi", "fo", "fum"]
  baz := []
  
  "{-prefix|/|foo}" -> "/fred"
  "{-prefix|/|bar}" -> "/fee/fi/fo/fum"
  "{-prefix|/|baz}" -> ""
  "{-prefix|/|qux}" -> ""
 


SUFFIX

public static final TokenOperatorD3.Operator SUFFIX
4.4.5 The 'suffix' operator. The prefix operator MUST only have one variable in its expansion. More than one variable is an error condition. If the variable is undefined or an empty list then substitute the empty string. If the variable is a defined non-list then substitute the value of arg followed by the value of the variable. If the variable is a defined list then substitute the concatenation of every list value followed by the arg. Example:
  foo := "fred"
  bar := ["fee", "fi", "fo", "fum"]
  baz := []
  
  "{-suffix|/|foo}" -> "fred/"
  "{-suffix|/|bar}" -> "fee/fi/fo/fum/"
  "{-suffix|/|baz}" -> ""
  "{-suffix|/|qux}" -> ""
 


JOIN

public static final TokenOperatorD3.Operator JOIN
4.4.6 The 'join' operator. Supplying a list variable to the join operator is an error. For each variable that is defined and non-empty create a keyvalue string that is the concatenation of the variable name, "=", and the variable value. Concatenate more than one keyvalue string with intervening values of arg to create the substitution value. The order of variables MUST be preserved during substitution. Example:
  foo := "fred"
  bar := "barney"
  baz := ""
 
  "{-join|&|foo,bar,baz,qux}" -> "foo=fred&bar=barney&baz="
  "{-join|&|bar}" -> "bar=barney"
  "{-join|&|qux}" -> ""
 


LIST

public static final TokenOperatorD3.Operator LIST
4.4.7 The 'list' operator. The list operator MUST have only one variable in its expansion and that variable must be a list. More than one variable is an error. If the list is non-empty then substitute the concatenation of all the list members with intervening values of arg. If the list is empty or the variable is undefined them substitute the empty string. Example:
  foo := ["fred", "barney", "wilma"]
  bar := ["a", "", "c"]
  baz := ["betty"]
  qux := []
 
  "{-list|/|foo}" -> "fred/barney/wilma"
  "{-list|/|bar}" -> "a//c"
  "{-list|/|baz}" -> "betty"
  "{-list|/|qux}" -> ""
  "{-list|/|corge}" -> ""
 

Method Detail

values

public static TokenOperatorD3.Operator[] 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 (TokenOperatorD3.Operator c : TokenOperatorD3.Operator.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TokenOperatorD3.Operator valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null