public static ExprBoolean toExprBoolean(Expression left, Expression right, int operation) {
	if (left instanceof Literal && right instanceof Literal) {
	    Boolean l = ((Literal) left).getBoolean(null);
	    Boolean r = ((Literal) right).getBoolean(null);

	    if (l != null && r != null) {
		switch (operation) {
		case Factory.OP_BOOL_AND:
		    return left.getFactory().createLitBoolean(l.booleanValue() && r.booleanValue(), left.getStart(), right.getEnd());
		case Factory.OP_BOOL_OR:
		    return left.getFactory().createLitBoolean(l.booleanValue() || r.booleanValue(), left.getStart(), right.getEnd());
		case Factory.OP_BOOL_XOR:
		    return left.getFactory().createLitBoolean(l.booleanValue() ^ r.booleanValue(), left.getStart(), right.getEnd());
		}
	    }
	}
	return new OpBool(left, right, operation);
    }
public static ExprBoolean toExprBoolean ( Expression left , Expression right , int operation ) { if ( left instanceof Literal && right instanceof Literal ) { Boolean l = ( ( Literal ) left ) . getBoolean ( null ) ; Boolean r = ( ( Literal ) right ) . getBoolean ( null ) ; if ( l != null && r != null ) { switch ( operation ) { case Factory . OP_BOOL_AND : return left . getFactory ( ) . createLitBoolean ( l . booleanValue ( ) && r . booleanValue ( ) , left . getStart ( ) , right . getEnd ( ) ) ; case Factory . OP_BOOL_OR : return left . getFactory ( ) . createLitBoolean ( l . booleanValue ( ) || r . booleanValue ( ) , left . getStart ( ) , right . getEnd ( ) ) ; case Factory . OP_BOOL_XOR : return left . getFactory ( ) . createLitBoolean ( l . booleanValue ( ) ^ r . booleanValue ( ) , left . getStart ( ) , right . getEnd ( ) ) ; } } } return new OpBool ( left , right , operation ) ; }
Create a String expression from a Expression

@param left
@param right

@return String expression
@throws TemplateException