org.apache.cocoon.components.variables
Class DefaultVariableResolverFactory

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.variables.DefaultVariableResolverFactory
All Implemented Interfaces:
Component, Contextualizable, LogEnabled, Serviceable, ThreadSafe, VariableResolverFactory

public class DefaultVariableResolverFactory
extends AbstractLogEnabled
implements ThreadSafe, VariableResolverFactory, Component, Serviceable, Contextualizable

This factory component creates a VariableResolver for an expression. A VariableResolver can then be used at runtime to resolve a variable with the current value. A variable can contain dynamic parts that are contained in {...},

Version:
CVS $Id: DefaultVariableResolverFactory.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler

Field Summary
protected  Context context
           
protected  ServiceManager manager
           
 
Fields inherited from interface org.apache.cocoon.components.variables.VariableResolverFactory
ROLE
 
Constructor Summary
DefaultVariableResolverFactory()
           
 
Method Summary
 void contextualize(Context context)
           
 VariableResolver lookup(String expression)
          Get a resolver for a given expression.
protected  boolean needsResolve(String expression)
          Does an expression need resolving (i.e. contain {...} patterns) ?
 void release(VariableResolver resolver)
           
 void service(ServiceManager manager)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

protected ServiceManager manager

context

protected Context context
Constructor Detail

DefaultVariableResolverFactory

public DefaultVariableResolverFactory()
Method Detail

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

lookup

public VariableResolver lookup(String expression)
                        throws PatternException
Get a resolver for a given expression. Chooses the most efficient implementation depending on expression. Don't forget to release the resolver

Specified by:
lookup in interface VariableResolverFactory
Throws:
PatternException

release

public void release(VariableResolver resolver)
Specified by:
release in interface VariableResolverFactory

needsResolve

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


contextualize

public void contextualize(Context context)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
Throws:
ContextException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.