Class AbstractRuleBuilderEnumOptionsExtensionListener

java.lang.Object
org.broadleafcommerce.openadmin.web.rulebuilder.enums.AbstractRuleBuilderEnumOptionsExtensionListener
All Implemented Interfaces:
RuleBuilderEnumOptionsExtensionListener

public abstract class AbstractRuleBuilderEnumOptionsExtensionListener extends Object implements RuleBuilderEnumOptionsExtensionListener
Abstract extension listener for rule builder enum options that handles the boilerplate code required for setting up the response to the client. This class provides two abstract methods that must be implemented, #getVariableName() and #getEnumClass(). Generates a String with the following pattern:
 var variableName = [
     {"enumType": "enumFriendlyType"},
     {"enumType2": "enumFriendlyType2"},
     ...
     {"enumTypeN": "enumFriendlyTypeN"}
 ];
 
Author:
Andre Azzolini (apazzolini)
  • Constructor Details

    • AbstractRuleBuilderEnumOptionsExtensionListener

      public AbstractRuleBuilderEnumOptionsExtensionListener()
  • Method Details

    • getOptionValues

      public String getOptionValues()
      Specified by:
      getOptionValues in interface RuleBuilderEnumOptionsExtensionListener
    • getTypes

      protected Map<String,? extends org.broadleafcommerce.common.BroadleafEnumerationType> getTypes(Class<? extends org.broadleafcommerce.common.BroadleafEnumerationType> clazz)
    • getValuesToGenerate

      protected abstract Map<String,Class<? extends org.broadleafcommerce.common.BroadleafEnumerationType>> getValuesToGenerate()
      Returns:
      a map representing the various values that this extension listener should generate