Class DefaultRuleIrVariablesGenerator
java.lang.Object
de.hybris.platform.ruleengineservices.compiler.impl.DefaultRuleIrVariablesGenerator
- All Implemented Interfaces:
RuleIrVariablesGenerator
Default implementation of
RuleIrVariablesGenerator-
Field Summary
FieldsFields inherited from interface de.hybris.platform.ruleengineservices.compiler.RuleIrVariablesGenerator
CONTAINER_PATH_SEPARATOR, DEFAULT_VARIABLES_CONTAINER_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCloses the current container.Creates a new container and uses the current one as parent.Creates a new local container.protected RuleIrVariablefindVariable(RuleIrVariablesContainer container, Class<?> type) generateLocalVariable(RuleIrLocalVariablesContainer container, Class<?> type) Generates a new variable for the given local container and type.generateVariable(Class<?> type) Generates a new variable for the given type.protected StringgenerateVariableName(Class<?> type) Returns the current container.Returns the root container.
-
Field Details
-
DEFAULT_VARIABLE_PREFIX
- See Also:
-
-
Constructor Details
-
DefaultRuleIrVariablesGenerator
public DefaultRuleIrVariablesGenerator()
-
-
Method Details
-
getRootContainer
Description copied from interface:RuleIrVariablesGeneratorReturns the root container.- Specified by:
getRootContainerin interfaceRuleIrVariablesGenerator- Returns:
- the root container
-
getCurrentContainer
Description copied from interface:RuleIrVariablesGeneratorReturns the current container.- Specified by:
getCurrentContainerin interfaceRuleIrVariablesGenerator- Returns:
- the current container
-
createContainer
Description copied from interface:RuleIrVariablesGeneratorCreates a new container and uses the current one as parent. The new container is set as the current one.- Specified by:
createContainerin interfaceRuleIrVariablesGenerator- Parameters:
id- - the id for the new container- Returns:
- the current container
-
closeContainer
public void closeContainer()Description copied from interface:RuleIrVariablesGeneratorCloses the current container. The parent container is set as the current one.- Specified by:
closeContainerin interfaceRuleIrVariablesGenerator
-
generateVariable
Description copied from interface:RuleIrVariablesGeneratorGenerates a new variable for the given type. If a variable already exists for the given type in the current container or any of the parent containers, it will be used. If not, a new one will be created in the current container.- Specified by:
generateVariablein interfaceRuleIrVariablesGenerator- Parameters:
type- - the type- Returns:
- the name of the variable
-
findVariable
-
createLocalContainer
Description copied from interface:RuleIrVariablesGeneratorCreates a new local container.- Specified by:
createLocalContainerin interfaceRuleIrVariablesGenerator- Returns:
- the current container
-
generateLocalVariable
Description copied from interface:RuleIrVariablesGeneratorGenerates a new variable for the given local container and type.- Specified by:
generateLocalVariablein interfaceRuleIrVariablesGeneratortype- - the type- Returns:
- the name of the variable
-
generateVariableName
-