org.weborganic.berlioz.content
Class ParameterTemplate

java.lang.Object
  extended by org.weborganic.berlioz.content.ParameterTemplate

public final class ParameterTemplate
extends Object

Defines a simple template for parameter values.

Since:
Berlioz 0.8.2
Version:
Berlioz 0.8.3 - 28 June 2011
Author:
Christophe Lauret

Method Summary
static ParameterTemplate parameter(String name, String def)
          Returns a template for single constant string value.
static ParameterTemplate parse(String template)
          Returns the value of this template using the content request.
 String toString(Map<String,String> map)
          Resolves this template using the specified content request.
static ParameterTemplate value(String value)
          Returns a template for single constant string value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toString

public String toString(Map<String,String> map)
Resolves this template using the specified content request.

Parameters:
map - A map of values to use.
Returns:
the resolved template as a string.

parse

public static ParameterTemplate parse(String template)
Returns the value of this template using the content request.

Parameters:
template - The template to parse.
Returns:
the resolved template.

value

public static ParameterTemplate value(String value)
Returns a template for single constant string value.

Use this method when you know that the template is made of a single plain value and does not require to be parsed.

Parameters:
value - The value.
Returns:
the corresponding template.

parameter

public static ParameterTemplate parameter(String name,
                                          String def)
Returns a template for single constant string value.

Use this method when you know that the template is made of a single plain value and does not require to be parsed.

Parameters:
name - The value.
def - The default value for the parameter (optional)
Returns:
the corresponding template.