org.apache.cocoon.components.treeprocessor.variables
Class VariableResolver

java.lang.Object
  extended byorg.apache.cocoon.components.treeprocessor.variables.VariableResolver
Direct Known Subclasses:
NOPVariableResolver, PreparedVariableResolver, StringTemplateParserVariableResolver

public abstract class VariableResolver
extends Object

Utility class for handling {...} pattern substitutions in sitemap statements.

Version:
$Id: VariableResolver.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
protected  String originalExpr
           
static String ROLE
           
 
Constructor Summary
protected VariableResolver()
           
protected VariableResolver(String expr)
           
 
Method Summary
static Map buildMap(Map expressions, InvokeContext context, Map objectModel)
          Build a Map from a Map of named ListOfMapResolvers and a list of Maps used for resolution.
static Parameters buildParameters(Map expressions, InvokeContext context, Map objectModel)
          Build a Parameters object from a Map of named VariableResolvers and a list of Maps used for resolution.
 boolean equals(Object object)
          Compare two VariableResolvers
 int hashCode()
          generate HashCode needed to determine uniqueness within hashtables
abstract  String resolve(InvokeContext context, Map objectModel)
          Resolve all {...} patterns using the values given in the list of maps and the object model.
 String resolve(Map objectModel)
          Resolve all {...} patterns using the values given in the object model.
abstract  void setExpression(String expression)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ROLE

public static final String ROLE

originalExpr

protected String originalExpr
Constructor Detail

VariableResolver

protected VariableResolver()

VariableResolver

protected VariableResolver(String expr)
Method Detail

setExpression

public abstract void setExpression(String expression)
                            throws org.apache.cocoon.sitemap.PatternException
Throws:
org.apache.cocoon.sitemap.PatternException

toString

public final String toString()

equals

public boolean equals(Object object)
Compare two VariableResolvers


hashCode

public int hashCode()
generate HashCode needed to determine uniqueness within hashtables


resolve

public String resolve(Map objectModel)
               throws org.apache.cocoon.sitemap.PatternException
Resolve all {...} patterns using the values given in the object model.

Throws:
org.apache.cocoon.sitemap.PatternException

resolve

public abstract String resolve(InvokeContext context,
                               Map objectModel)
                        throws org.apache.cocoon.sitemap.PatternException
Resolve all {...} patterns using the values given in the list of maps and the object model.

Throws:
org.apache.cocoon.sitemap.PatternException

buildParameters

public static Parameters buildParameters(Map expressions,
                                         InvokeContext context,
                                         Map objectModel)
                                  throws org.apache.cocoon.sitemap.PatternException
Build a Parameters object from a Map of named VariableResolvers and a list of Maps used for resolution.

Returns:
a fully resolved Parameters.
Throws:
org.apache.cocoon.sitemap.PatternException

buildMap

public static Map buildMap(Map expressions,
                           InvokeContext context,
                           Map objectModel)
                    throws org.apache.cocoon.sitemap.PatternException
Build a Map from a Map of named ListOfMapResolvers and a list of Maps used for resolution.

Returns:
a fully resolved Map.
Throws:
org.apache.cocoon.sitemap.PatternException


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.