Class ComponentPropertiesHelper

java.lang.Object
org.chenile.stm.impl.ComponentPropertiesHelper

public final class ComponentPropertiesHelper extends Object
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 Details

  • Constructor Details

    • ComponentPropertiesHelper

      public ComponentPropertiesHelper()
  • Method Details

    • getScriptingStrategy

      public ScriptingStrategy getScriptingStrategy()
    • setScriptingStrategy

      public void setScriptingStrategy(ScriptingStrategy scriptingStrategy)
    • getComponentProperties

      private Map<String,Object> getComponentProperties(StateEntity stateEntity)
    • 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

      public String transform(String s, StateEntity stateEntity) throws Exception
      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 substitute
      stateEntity - the context from which the place holders are picked up.
      Returns:
      the transformed string.
      Throws:
      Exception
    • setFlowConfigurator

      public void setFlowConfigurator(STMFlowStore flowConfigurator)