Interface RuleIrVariablesGenerator
- All Known Implementing Classes:
DefaultRuleIrVariablesGenerator
public interface RuleIrVariablesGenerator
Implementations of this interface are responsible for generating variables.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidCloses the current container.Creates a new container and uses the current one as parent.Creates a new local container.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.Returns the current container.Returns the root container.
-
Field Details
-
DEFAULT_VARIABLES_CONTAINER_ID
- See Also:
-
CONTAINER_PATH_SEPARATOR
- See Also:
-
-
Method Details
-
getRootContainer
RuleIrVariablesContainer getRootContainer()Returns the root container.- Returns:
- the root container
-
getCurrentContainer
RuleIrVariablesContainer getCurrentContainer()Returns the current container.- Returns:
- the current container
-
createContainer
Creates a new container and uses the current one as parent. The new container is set as the current one.- Parameters:
id- - the id for the new container- Returns:
- the current container
-
closeContainer
void closeContainer()Closes the current container. The parent container is set as the current one. -
generateVariable
Generates 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.- Parameters:
type- - the type- Returns:
- the name of the variable
-
createLocalContainer
RuleIrLocalVariablesContainer createLocalContainer()Creates a new local container.- Returns:
- the current container
-
generateLocalVariable
Generates a new variable for the given local container and type.- Parameters:
type- - the type- Returns:
- the name of the variable
-