Interface ExpressionCompiler


  • public interface ExpressionCompiler
    A compiler for expression strings based on a domain model.
    Since:
    1.0.0
    Author:
    Christian Beikov
    • Method Detail

      • createContext

        ExpressionCompiler.Context createContext​(Map<String,​com.blazebit.domain.runtime.model.DomainType> rootDomainTypes)
        Creates a compile context based on the given root variable domain type mapping.
        Parameters:
        rootDomainTypes - The root variable domain type mapping
        Returns:
        a new compile context
      • createContext

        ExpressionCompiler.Context createContext​(Map<String,​com.blazebit.domain.runtime.model.DomainType> rootDomainTypes,
                                                 ImplicitRootProvider implicitRootProvider)
        Creates a compile context based on the given root variable domain type mapping.
        Parameters:
        rootDomainTypes - The root variable domain type mapping
        implicitRootProvider - The implicit root provider
        Returns:
        a new compile context
      • createExpression

        default Expression createExpression​(String expressionString)
        Creates and compiles the given expression string with an empty compile context.
        Parameters:
        expressionString - The expression string to compile
        Returns:
        The compiled expression
      • createExpression

        Expression createExpression​(String expressionString,
                                    ExpressionCompiler.Context compileContext)
        Creates and compiles the given expression string with the given compile context.
        Parameters:
        expressionString - The expression string to compile
        compileContext - The compile context to use
        Returns:
        The compiled expression
      • createPredicate

        default Predicate createPredicate​(String expressionString)
        Creates and compiles the given predicate string with an empty compile context.
        Parameters:
        expressionString - The predicate string to compile
        Returns:
        The compiled predicate
      • createPredicate

        Predicate createPredicate​(String expressionString,
                                  ExpressionCompiler.Context compileContext)
        Creates and compiles the given predicate string with the given compile context.
        Parameters:
        expressionString - The predicate string to compile
        compileContext - The compile context to use
        Returns:
        The compiled predicate
      • createExpressionOrPredicate

        default Expression createExpressionOrPredicate​(String expressionString)
        Creates and compiles the given expression string with an empty compile context.
        Parameters:
        expressionString - The expression string to compile
        Returns:
        The compiled expression
      • createExpressionOrPredicate

        Expression createExpressionOrPredicate​(String expressionString,
                                               ExpressionCompiler.Context compileContext)
        Creates and compiles the given expression string with the given compile context.
        Parameters:
        expressionString - The expression string to compile
        compileContext - The compile context to use
        Returns:
        The compiled expression
      • createTemplateExpression

        default Expression createTemplateExpression​(String templateString)
        Creates and compiles the given template expression string with an empty compile context.
        Parameters:
        templateString - The template expression string to compile
        Returns:
        The compiled expression
      • createTemplateExpression

        Expression createTemplateExpression​(String templateString,
                                            ExpressionCompiler.Context compileContext)
        Creates and compiles the given template expression string with the given compile context.
        Parameters:
        templateString - The template expression string to compile
        compileContext - The compile context to use
        Returns:
        The compiled expression