org.pentaho.platform.engine.services.runtime
Class MapParameterResolver

java.lang.Object
  extended by org.pentaho.platform.engine.core.system.PentahoBase
      extended by org.pentaho.platform.engine.services.PentahoMessenger
          extended by org.pentaho.platform.engine.services.runtime.MapParameterResolver
All Implemented Interfaces:
Serializable, ILogger, IParameterResolver

public class MapParameterResolver
extends PentahoMessenger
implements IParameterResolver

This is a utility class that implements the IParameterResolver and resolves parameters based on a lookup map provided.

Author:
Will Gorman
See Also:
MDXBaseComponent, HQLBaseComponent, XQueryBaseComponent, Serialized Form

Field Summary
 
Fields inherited from class org.pentaho.platform.engine.core.system.PentahoBase
EMPTYLOGID, LOGID_MASK1, LOGID_MASK2, LOGID_SEPARATOR
 
Fields inherited from interface org.pentaho.platform.api.engine.ILogger
ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
 
Constructor Summary
MapParameterResolver(Map map, String prefix, IRuntimeContext runtime)
           
 
Method Summary
 org.apache.commons.logging.Log getLogger()
           
 int resolveParameter(String template, String parameter, Matcher parameterMatcher, int copyStart, StringBuffer results)
          This method is called when TemplateUtil.applyTemplate() encounters a parameter.
 
Methods inherited from class org.pentaho.platform.engine.services.PentahoMessenger
debug, debug, error, error, error, fatal, fatal, getMessages, getUserString, info, info, setMessages, trace, trace, warn, warn
 
Methods inherited from class org.pentaho.platform.engine.core.system.PentahoBase
genLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, getLogId, getObjectName, setLoggingLevel, setLogId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapParameterResolver

public MapParameterResolver(Map map,
                            String prefix,
                            IRuntimeContext runtime)
Method Detail

getLogger

public org.apache.commons.logging.Log getLogger()
Specified by:
getLogger in class PentahoBase

resolveParameter

public int resolveParameter(String template,
                            String parameter,
                            Matcher parameterMatcher,
                            int copyStart,
                            StringBuffer results)
This method is called when TemplateUtil.applyTemplate() encounters a parameter.

Specified by:
resolveParameter in interface IParameterResolver
Parameters:
template - the source string
parameter - the parameter value
parameterMatcher - the regex parameter matcher
copyStart - the start of the copy
results - the output result
Returns:
the next copystart