Package com.blazebit.expression
Interface ExpressionCompiler
-
public interface ExpressionCompiler
A compiler for expression strings based on a domain model.- Since:
- 1.0.0
- Author:
- Christian Beikov
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ExpressionCompiler.Context
A compiler context that returns the domain type for available root variables.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description 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.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.default Expression
createExpression(String expressionString)
Creates and compiles the given expression string with an empty compile context.Expression
createExpression(String expressionString, ExpressionCompiler.Context compileContext)
Creates and compiles the given expression string with the given compile context.default Expression
createExpressionOrPredicate(String expressionString)
Creates and compiles the given expression string with an empty compile context.Expression
createExpressionOrPredicate(String expressionString, ExpressionCompiler.Context compileContext)
Creates and compiles the given expression string with the given compile context.default Predicate
createPredicate(String expressionString)
Creates and compiles the given predicate string with an empty compile context.Predicate
createPredicate(String expressionString, ExpressionCompiler.Context compileContext)
Creates and compiles the given predicate string with the given compile context.default Expression
createTemplateExpression(String templateString)
Creates and compiles the given template expression string with an empty compile context.Expression
createTemplateExpression(String templateString, ExpressionCompiler.Context compileContext)
Creates and compiles the given template expression string with the given compile context.
-
-
-
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 mappingimplicitRootProvider
- 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 compilecompileContext
- 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 compilecompileContext
- 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 compilecompileContext
- 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 compilecompileContext
- The compile context to use- Returns:
- The compiled expression
-
-