Package io.atlasmap.expression.internal
Class ConstantExpression
- java.lang.Object
-
- io.atlasmap.expression.internal.ConstantExpression
-
- All Implemented Interfaces:
Expression
public class ConstantExpression extends Object implements Expression
Represents a constant expression.- Version:
- $Revision: 1.2 $
-
-
Field Summary
Fields Modifier and Type Field Description static io.atlasmap.expression.internal.ConstantExpression.BooleanConstantExpressionFALSEfalse.static io.atlasmap.expression.internal.ConstantExpression.BooleanConstantExpressionNULLnull.static io.atlasmap.expression.internal.ConstantExpression.BooleanConstantExpressionTRUEtrue.-
Fields inherited from interface io.atlasmap.expression.Expression
CACHE
-
-
Constructor Summary
Constructors Constructor Description ConstantExpression(Object value)A constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConstantExpressioncreateFloat(String text)Creates from the float.static ConstantExpressioncreateFromDecimal(String text)Creates from the decimal.static ConstantExpressioncreateFromHex(String text)Creates from the hex.static ConstantExpressioncreateFromOctal(String text)Creates from the octal.static StringencodeString(String s)Encodes the value of string so that it looks like it would look like when it was provided in a selector.booleanequals(Object o)TODO: more efficient hashCode()io.atlasmap.v2.Fieldevaluate(ExpressionContext expressionContext)Evaluates the expression.ObjectgetValue()Gets the value.inthashCode()TODO: more efficient hashCode()StringtoString()
-
-
-
Field Detail
-
NULL
public static final io.atlasmap.expression.internal.ConstantExpression.BooleanConstantExpression NULL
null.
-
TRUE
public static final io.atlasmap.expression.internal.ConstantExpression.BooleanConstantExpression TRUE
true.
-
FALSE
public static final io.atlasmap.expression.internal.ConstantExpression.BooleanConstantExpression FALSE
false.
-
-
Constructor Detail
-
ConstantExpression
public ConstantExpression(Object value)
A constructor.- Parameters:
value- value
-
-
Method Detail
-
createFromDecimal
public static ConstantExpression createFromDecimal(String text)
Creates from the decimal.- Parameters:
text- decimal- Returns:
- result
-
createFromHex
public static ConstantExpression createFromHex(String text)
Creates from the hex.- Parameters:
text- hex- Returns:
- result
-
createFromOctal
public static ConstantExpression createFromOctal(String text)
Creates from the octal.- Parameters:
text- octal- Returns:
- result
-
createFloat
public static ConstantExpression createFloat(String text)
Creates from the float.- Parameters:
text- float- Returns:
- result
-
evaluate
public io.atlasmap.v2.Field evaluate(ExpressionContext expressionContext) throws ExpressionException
Evaluates the expression.- Specified by:
evaluatein interfaceExpression- Parameters:
expressionContext- expression context- Returns:
Field- Throws:
ExpressionException- If evaluation fails
-
getValue
public Object getValue()
Gets the value.- Returns:
- value
-
equals
public boolean equals(Object o)
TODO: more efficient hashCode()
-
-