public String evaluateAsString(OExpression cexp, EvaluationContext ctx) throws FaultException , EvaluationException { OConstantExpression konst = (OConstantExpression) cexp; if (konst.getVal() instanceof String) return (String) konst.getVal(); throw new TypeCastException(TypeCastException.TYPE_STRING, konst.getVal().toString()); }
/** * Produce a boolean {@link OExpression} expression that returns a constant * value. * * @param value * constant value to return * @return {@link OExpression} returning a constant value. */ public OExpression constantExpr(boolean value) { OConstantExpression ce = new OConstantExpression(_oprocess, value ? Boolean.TRUE : Boolean.FALSE); ce.debugInfo = createDebugInfo(_processDef, "Constant Boolean Expression: " + value); ce.expressionLanguage = _konstExprLang; return ce; }
public List evaluate(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException { OConstantExpression konst = (OConstantExpression) cexp; if (konst.getVal() instanceof List) return (List) konst.getVal(); throw new TypeCastException(TypeCastException.TYPE_NODELIST, konst.getVal().toString()); }
public Node evaluateNode(OExpression cexp, EvaluationContext context) throws FaultException, EvaluationException { OConstantExpression konst = (OConstantExpression) cexp; if (konst.getVal() instanceof Node) return (Node) konst.getVal(); throw new TypeCastException(TypeCastException.TYPE_NODE, konst.getVal().toString()); }
public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException { OConstantExpression konst = (OConstantExpression) cexp; if (konst.getVal() instanceof Boolean) return ((Boolean)konst.getVal()).booleanValue(); throw new TypeCastException(TypeCastException.TYPE_BOOLEAN, konst.getVal().toString()); }
public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException { OConstantExpression konst = (OConstantExpression) cexp; if (konst.getVal() instanceof Number) return (Number)konst.getVal(); throw new TypeCastException(TypeCastException.TYPE_NUMBER, konst.getVal().toString()); }
public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context) throws FaultException , EvaluationException { OConstantExpression konst = (OConstantExpression) cexp; if (konst.getVal() instanceof Calendar) return (Calendar) konst.getVal(); throw new TypeCastException(TypeCastException.TYPE_DATE, konst.getVal().toString()); }
public Duration evaluateAsDuration(OExpression cexp, EvaluationContext context) throws FaultException, EvaluationException { OConstantExpression konst = (OConstantExpression) cexp; if (konst.getVal() instanceof Duration) return (Duration) konst.getVal(); throw new TypeCastException(TypeCastException.TYPE_DURATION, konst.getVal().toString()); } }