com.github.fge.uritemplate.vars.values
Enum ValueType

java.lang.Object
  extended by java.lang.Enum<ValueType>
      extended by com.github.fge.uritemplate.vars.values.ValueType
All Implemented Interfaces:
Serializable, Comparable<ValueType>

public enum ValueType
extends Enum<ValueType>

Enumeration of the different types of variable values

The type of the value also determines how it is expanded. Therefore, this enumeration also instantiates renderers.

See Also:
ValueRenderer

Enum Constant Summary
ARRAY
          Array/list values
MAP
          Map values
SCALAR
          Scalar values (simple string values)
 
Method Summary
abstract  ValueRenderer selectRenderer(ExpressionType type)
          Get the renderer for this value type and expression type
 String toString()
           
static ValueType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ValueType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SCALAR

public static final ValueType SCALAR
Scalar values (simple string values)


ARRAY

public static final ValueType ARRAY
Array/list values


MAP

public static final ValueType MAP
Map values

Note: the RFC calls these "associative arrays".

Method Detail

values

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

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

valueOf

public static ValueType 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

selectRenderer

public abstract ValueRenderer selectRenderer(ExpressionType type)
Get the renderer for this value type and expression type

Parameters:
type - the expression type
Returns:
the appropriate renderer

toString

public String toString()
Overrides:
toString in class Enum<ValueType>