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

java.lang.Object
  extended byorg.apache.cocoon.components.treeprocessor.variables.VariableResolverFactory

public class VariableResolverFactory
extends Object

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

Constructor Summary
VariableResolverFactory()
           
 
Method Summary
static VariableResolver getResolver(String expression, ServiceManager manager)
          Get a resolver for a given expression.
static boolean needsResolve(String expression)
          Does an expression need resolving (i.e.
static void setDisposableCollector(List collector)
          Set the thread-local list where all created resolvers that need to be disposed will be collected.
static String unescape(String expression)
          Unescape an expression that doesn't need to be resolved, but may contain escaped '{' characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableResolverFactory

public VariableResolverFactory()
Method Detail

setDisposableCollector

public static void setDisposableCollector(List collector)
Set the thread-local list where all created resolvers that need to be disposed will be collected.

The purpose of collecting resolvers is to avoid manual release (or lack thereof) that requires most ProcessingNodes to implement Disposable.


needsResolve

public static boolean needsResolve(String expression)
Does an expression need resolving (i.e. contain {...} patterns) ?


unescape

public static String unescape(String expression)
Unescape an expression that doesn't need to be resolved, but may contain escaped '{' characters.

Parameters:
expression - the expression to unescape.
Returns:
the unescaped result, or expression if unescaping isn't necessary.

getResolver

public static VariableResolver getResolver(String expression,
                                           ServiceManager manager)
                                    throws org.apache.cocoon.sitemap.PatternException
Get a resolver for a given expression. Chooses the most efficient implementation depending on expression.

Throws:
org.apache.cocoon.sitemap.PatternException


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