Class TemplateUtil
- java.lang.Object
-
- org.pentaho.platform.engine.services.runtime.TemplateUtil
-
public class TemplateUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description TemplateUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
applyTableTemplate(String template, Properties inputs, Pattern parameterPattern, StringBuffer results)
static String
applyTemplate(String template, String name, String value)
static String
applyTemplate(String template, String name, String[] value)
static String
applyTemplate(String template, Properties inputs, Pattern parameterPattern, org.pentaho.platform.api.engine.IParameterResolver resolver)
Processes a template by processing the parameters declared in the template.static String
applyTemplate(String template, Properties inputs, org.pentaho.platform.api.engine.IParameterResolver resolver)
static String
applyTemplate(String template, org.pentaho.platform.api.engine.IRuntimeContext context)
static String
applyTemplate(String template, org.pentaho.platform.api.engine.IRuntimeContext context, String parameterPatternStr)
static String
applyTemplate(String template, org.pentaho.platform.api.engine.IRuntimeContext context, org.pentaho.platform.api.engine.IParameterResolver resolver)
static String
getSystemInput(String inputName, org.pentaho.platform.api.engine.IRuntimeContext context)
static String
matchDateRegex(String parameter)
Uses regex matching to see if the input parameter appears to be a date expressionstatic String
matchDateRegex(String parameter, Properties inputs)
Uses regex matching to see if the input parameter appears to be a date expressionstatic Properties
parametersToProperties(org.pentaho.platform.api.engine.IParameterProvider parameterProvider)
-
-
-
Method Detail
-
getSystemInput
public static String getSystemInput(String inputName, org.pentaho.platform.api.engine.IRuntimeContext context)
-
applyTemplate
public static String applyTemplate(String template, org.pentaho.platform.api.engine.IRuntimeContext context, org.pentaho.platform.api.engine.IParameterResolver resolver)
-
applyTemplate
public static String applyTemplate(String template, org.pentaho.platform.api.engine.IRuntimeContext context)
-
applyTemplate
public static String applyTemplate(String template, org.pentaho.platform.api.engine.IRuntimeContext context, String parameterPatternStr)
-
applyTemplate
public static String applyTemplate(String template, Properties inputs, org.pentaho.platform.api.engine.IParameterResolver resolver)
-
applyTemplate
public static String applyTemplate(String template, Properties inputs, Pattern parameterPattern, org.pentaho.platform.api.engine.IParameterResolver resolver)
Processes a template by processing the parameters declared in the template. The parameters to be replaced are enclosed in curly brackets. Parameters can be the input values (as specified by the name of the input value) or date expressions. Parameters that can not be processed are left in the template.- Parameters:
template
- the template specification.input
- the input values communicated as aProperties
.locale
- the locale to use for the formatting of date expression. If null, the locale for the thread is used. If no locale for the thread, then the default locale is used.- Throws:
IllegalArgumentException
- if a date expression is illegal- See Also:
DateMath.calculateDateString(Calendar, String)
,PentahoSystem#getLocale()
,PentahoSystem#getDefaultLocale()
-
applyTableTemplate
public static void applyTableTemplate(String template, Properties inputs, Pattern parameterPattern, StringBuffer results)
-
matchDateRegex
public static String matchDateRegex(String parameter)
Uses regex matching to see if the input parameter appears to be a date expression- Parameters:
parameter
-- Returns:
- the value of the calculated date
-
matchDateRegex
public static String matchDateRegex(String parameter, Properties inputs)
Uses regex matching to see if the input parameter appears to be a date expression- Parameters:
parameter
-- Returns:
- the value of the calculated date
-
parametersToProperties
public static Properties parametersToProperties(org.pentaho.platform.api.engine.IParameterProvider parameterProvider)
-
-