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

java.lang.Object
  extended by org.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.html 1304258 2012-03-23 10:09:27Z ilgrosso $
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()
Overrides:
toString in class Object

equals

public boolean equals(Object object)
Compare two VariableResolvers

Overrides:
equals in class Object

hashCode

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

Overrides:
hashCode in class Object

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-2010 The Apache Software Foundation. All Rights Reserved.