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

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

public abstract class VariableResolver
extends Object

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

Version:
CVS $Id: VariableResolver.java 233343 2005-08-18 18:06:44Z sylvain $
Author:
Sylvain Wallez

Field Summary
static Map EMPTY_MAP
           
protected  String originalExpr
           
 
Constructor Summary
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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_MAP

public static final Map EMPTY_MAP

originalExpr

protected final String originalExpr
Constructor Detail

VariableResolver

protected VariableResolver(String expr)
Method Detail

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 PatternException
Resolve all {...} patterns using the values given in the object model.

Throws:
PatternException

resolve

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

Throws:
PatternException

buildParameters

public static Parameters buildParameters(Map expressions,
                                         InvokeContext context,
                                         Map objectModel)
                                  throws 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:
PatternException

buildMap

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

Returns:
a fully resolved Map.
Throws:
PatternException


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.