Package com.blackrook.expression
Class ExpressionFactory
- java.lang.Object
-
- com.blackrook.expression.ExpressionFactory
-
public final class ExpressionFactory extends Object
Creates expression objects from input text.- Author:
- Matthew Tropiano
-
-
Constructor Summary
Constructors Constructor Description ExpressionFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Expression
parseExpression(Reader reader, ExpressionFunctionResolver resolver)
Parses a single-line expression.static Expression
parseExpression(String inputString)
Parses a single-line expression.static Expression
parseExpression(String inputString, ExpressionFunctionResolver resolver)
Parses a single-line expression.static Expression
parseExpressionBlock(Reader reader, ExpressionFunctionResolver resolver)
Parses an expression block (multi-line/statement expression).static Expression
parseExpressionBlock(String inputString)
Parses an expression block (multi-line/statement expression).static Expression
parseExpressionBlock(String inputString, ExpressionFunctionResolver resolver)
Parses an expression block (multi-line/statement expression).
-
-
-
Method Detail
-
parseExpression
public static Expression parseExpression(String inputString)
Parses a single-line expression. The expression returned may be a reference to an expression parsed before, due to intern-ing it.- Parameters:
inputString
- the input string to parse from.- Returns:
- the expression parsed.
- Throws:
ExpressionParseException
- if a parse error occurs.
-
parseExpressionBlock
public static Expression parseExpressionBlock(String inputString)
Parses an expression block (multi-line/statement expression). The expression returned may be a reference to an expression parsed before, due to intern-ing it.- Parameters:
inputString
- the input string to parse from.- Returns:
- the expression parsed.
- Throws:
ExpressionParseException
- if a parse error occurs.
-
parseExpression
public static Expression parseExpression(String inputString, ExpressionFunctionResolver resolver)
Parses a single-line expression. The expression returned may be a reference to an expression parsed before, due to intern-ing it.- Parameters:
inputString
- the input string to parse from.resolver
- the resolver object for resolving functions in the script.- Returns:
- the expression parsed.
- Throws:
ExpressionParseException
- if a parse error occurs.
-
parseExpressionBlock
public static Expression parseExpressionBlock(String inputString, ExpressionFunctionResolver resolver)
Parses an expression block (multi-line/statement expression). The expression returned may be a reference to an expression parsed before, due to intern-ing it.- Parameters:
inputString
- the input string to parse from.resolver
- the resolver object for resolving functions in the script.- Returns:
- the expression parsed.
- Throws:
ExpressionParseException
- if a parse error occurs.
-
parseExpression
public static Expression parseExpression(Reader reader, ExpressionFunctionResolver resolver)
Parses a single-line expression. The expression returned may be a reference to an expression parsed before, due to intern-ing it.- Parameters:
reader
- the reader to parse from.resolver
- the resolver object for resolving functions in the script.- Returns:
- the expression parsed.
- Throws:
ExpressionParseException
- if a parse error occurs.
-
parseExpressionBlock
public static Expression parseExpressionBlock(Reader reader, ExpressionFunctionResolver resolver)
Parses an expression block (multi-line/statement expression). The expression returned may be a reference to an expression parsed before, due to intern-ing it.- Parameters:
reader
- the reader to parse from.resolver
- the resolver object for resolving functions in the script.- Returns:
- the expression parsed.
- Throws:
ExpressionParseException
- if a parse error occurs.
-
-