org.loom.mapping
Class UriToken

java.lang.Object
  extended by org.loom.mapping.UriToken

public class UriToken
extends java.lang.Object

A token in the uri path.


Nested Class Summary
static class UriToken.ParserAction
          The actions that are indicated to the parser
 
Constructor Summary
UriToken()
           
 
Method Summary
 java.lang.String getHandle()
           
 java.lang.String getName()
           
 boolean isRequired()
           
 UriToken.ParserAction match(java.lang.String uri, java.text.ParsePosition pp, java.util.Map<java.lang.String,java.lang.String> params, UriToken nextToken)
          Extract the next ParamValue from the uri that is being parsed
 void setHandle(java.lang.String handle)
           
 void setName(java.lang.String name)
           
 void setRequired(boolean required)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UriToken

public UriToken()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

match

public UriToken.ParserAction match(java.lang.String uri,
                                   java.text.ParsePosition pp,
                                   java.util.Map<java.lang.String,java.lang.String> params,
                                   UriToken nextToken)
Extract the next ParamValue from the uri that is being parsed

Parameters:
uri - the uri that is being parsed
pp - the current position. If there is a match, its current index will be incremented pointing to the first character after this token.
params - the list of extracted parameters. If this token is a match, the parsed value (if any) will be added.
nextToken - the next token, null if none.
Returns:
true if the token was a match, false if not.

isRequired

public boolean isRequired()

setRequired

public void setRequired(boolean required)

getHandle

public java.lang.String getHandle()

setHandle

public void setHandle(java.lang.String handle)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)