Interface RuleIrVariablesGenerator

  • All Known Implementing Classes:
    DefaultRuleIrVariablesGenerator

    public interface RuleIrVariablesGenerator
    Implementations of this interface are responsible for generating variables.
    • Field Detail

      • DEFAULT_VARIABLES_CONTAINER_ID

        static final java.lang.String DEFAULT_VARIABLES_CONTAINER_ID
        See Also:
        Constant Field Values
      • CONTAINER_PATH_SEPARATOR

        static final java.lang.String CONTAINER_PATH_SEPARATOR
        See Also:
        Constant Field Values
    • Method Detail

      • getCurrentContainer

        RuleIrVariablesContainer getCurrentContainer()
        Returns the current container.
        Returns:
        the current container
      • createContainer

        RuleIrVariablesContainer createContainer​(java.lang.String id)
        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

        java.lang.String generateVariable​(java.lang.Class<?> type)
        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
      • generateLocalVariable

        java.lang.String generateLocalVariable​(RuleIrLocalVariablesContainer container,
                                               java.lang.Class<?> type)
        Generates a new variable for the given local container and type.
        Parameters:
        type - - the type
        Returns:
        the name of the variable