Package org.chenile.stm.impl
Class ComponentPropertiesHelper
java.lang.Object
org.chenile.stm.impl.ComponentPropertiesHelper
A helper class to obtain the properties for the current action (as passed in the flow context). This class is aware
of the current scripting strategy and uses it to transform the incoming property.
This is useful to support component properties whose values are based on the flow context passed to the STM.
- Author:
- Raja Shankar Kolluru
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetComponentProperties
(StateEntity stateEntity) getComponentProperty
(StateEntity stateEntity, String componentPropertyName, boolean inlineScriptsTranslated) getListComponentProperty
(StateEntity stateEntity, String propertyName, boolean inlineScriptsTranslated) getMapComponentProperty
(StateEntity stateEntity, String propertyName, boolean inlineScriptsTranslated) void
setFlowConfigurator
(STMFlowStore flowConfigurator) void
setScriptingStrategy
(ScriptingStrategy scriptingStrategy) transform
(String s, StateEntity stateEntity) Transforms the string by replacing the placeholders (of the form ${xxx}) with the values obtained by substituting stuff from the state entity.
-
Field Details
-
scriptingStrategy
-
flowConfigurator
-
-
Constructor Details
-
ComponentPropertiesHelper
public ComponentPropertiesHelper()
-
-
Method Details
-
getScriptingStrategy
-
setScriptingStrategy
-
getComponentProperties
-
getComponentProperty
public String getComponentProperty(StateEntity stateEntity, String componentPropertyName, boolean inlineScriptsTranslated) throws Exception - Throws:
Exception
-
getListComponentProperty
public List<String> getListComponentProperty(StateEntity stateEntity, String propertyName, boolean inlineScriptsTranslated) throws Exception - Throws:
Exception
-
getMapComponentProperty
public Map<String,String> getMapComponentProperty(StateEntity stateEntity, String propertyName, boolean inlineScriptsTranslated) throws Exception - Throws:
Exception
-
transform
Transforms the string by replacing the placeholders (of the form ${xxx}) with the values obtained by substituting stuff from the state entity.- Parameters:
s
- the string to substitutestateEntity
- the context from which the place holders are picked up.- Returns:
- the transformed string.
- Throws:
Exception
-
setFlowConfigurator
-