org.mule.module.apikit.uri
Enum TokenFactory.Syntax

java.lang.Object
  extended by java.lang.Enum<TokenFactory.Syntax>
      extended by org.mule.module.apikit.uri.TokenFactory.Syntax
All Implemented Interfaces:
Serializable, Comparable<TokenFactory.Syntax>
Enclosing class:
TokenFactory

public static enum TokenFactory.Syntax
extends Enum<TokenFactory.Syntax>

A syntax to use for creating tokens.

Version:
6 November 2009
Author:
Christophe Lauret

Enum Constant Summary
DRAFT3
          Use the syntax defined in Draft 3 of the URI templates.
DRAFTX
          Use a syntax based on the draft as of 29 October 2009.
PAGESEEDER
          Use a syntax currently used in PageSeeder and based on what was suggested by Roy T Fielding on the W3C URI listing in October 2008.
 
Method Summary
protected abstract  Token newExpansion(String exp)
          Generates a template expansion token corresponding to the specified expression.
static TokenFactory.Syntax valueOf(String name)
          Returns the enum constant of this type with the specified name.
static TokenFactory.Syntax[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DRAFT3

public static final TokenFactory.Syntax DRAFT3
Use the syntax defined in Draft 3 of the URI templates.


PAGESEEDER

public static final TokenFactory.Syntax PAGESEEDER
Use a syntax currently used in PageSeeder and based on what was suggested by Roy T Fielding on the W3C URI listing in October 2008.


DRAFTX

public static final TokenFactory.Syntax DRAFTX
Use a syntax based on the draft as of 29 October 2009.

Method Detail

values

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

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

valueOf

public static TokenFactory.Syntax 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

newExpansion

protected abstract Token newExpansion(String exp)
Generates a template expansion token corresponding to the specified expression.

Parameters:
exp - The expression within the curly brackets {}.
Returns:
The corresponding token instance.
Throws:
URITemplateSyntaxException - If the expression could not be parsed as a valid token.


Copyright © 2013. All rights reserved.