Package com.googlecode.aviator.exception

Examples of com.googlecode.aviator.exception.ExpressionRuntimeException


            }
            else if (javaValue instanceof Character) {
                return match(new AviatorString(String.valueOf(javaValue)), env);
            }
            else {
                throw new ExpressionRuntimeException(this.desc(env) + " could not match " + other.desc(env));
            }
        default:
            throw new ExpressionRuntimeException(this.desc(env) + " could not match " + other.desc(env));
        }

    }
View Full Code Here


        case JavaType:
            if (other.getValue(env) == null) {
                return 1;
            }
            else {
                throw new ExpressionRuntimeException("Could not compare Pattern with " + other.getAviatorType());
            }
        case Nil:
            return 1;
        default:
            throw new ExpressionRuntimeException("Could not compare Pattern with " + other.getAviatorType());
        }
    }
View Full Code Here

            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SS");
            Date thisDate = simpleDateFormat.parse(this.lexeme);
            return thisDate.compareTo(otherDate);
        }
        catch (Throwable t) {
            throw new ExpressionRuntimeException("Compare date error", t);
        }
    }
View Full Code Here

            }
            else if (otherJavaValue instanceof Date) {
                return tryCompareDate((Date) otherJavaValue);
            }
            else {
                throw new ExpressionRuntimeException("Could not compare " + this + " with " + other);
            }
        case Nil:
            return 1;
        default:
            throw new ExpressionRuntimeException("Could not compare " + this + " with " + other);
        }
    }
View Full Code Here

            else {
                return 0;
            }
        }
        else {
            throw new ExpressionRuntimeException("Could not compare " + this + " with " + other);
        }
    }
View Full Code Here

            }
            if (otherValue instanceof Boolean) {
                return this.value.compareTo((Boolean) otherValue);
            }
            else {
                throw new ExpressionRuntimeException("Could not compare " + desc(env) + " with " + other.desc(env));
            }
        case Nil:
            return 1;
        default:
            throw new ExpressionRuntimeException("Could not compare " + this.desc(env) + " with " + other.desc(env));
        }

    }
View Full Code Here

                }
            }
            return null;
        }
        catch (Throwable t) {
            throw new ExpressionRuntimeException("Could not find variable " + name, t);
        }
    }
View Full Code Here

                else {
                    try {
                        return ((Comparable) thisValue).compareTo(otherValue);
                    }
                    catch (Throwable t) {
                        throw new ExpressionRuntimeException("Compare " + this + " with " + other + " error", t);
                    }
                }
            }
        case Nil:
            // Any object is greater than nil except nil
            if (this.getValue(env) == null) {
                return 0;
            }
            else {
                return 1;
            }
        default:
            throw new ExpressionRuntimeException("Unknow aviator type");
        }
    }
View Full Code Here

            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SS");
            Date otherDate = simpleDateFormat.parse((String) otherValue);
            return ((Date) thisValue).compareTo(otherDate);
        }
        catch (Throwable t) {
            throw new ExpressionRuntimeException("Compare date error", t);
        }
    }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    public AviatorObject getElement(Map<String, Object> env, AviatorObject indexObject) {
        Object thisValue = getValue(env);
        if (!thisValue.getClass().isArray() && !(thisValue instanceof List)) {
            throw new ExpressionRuntimeException(this.desc(env)
                    + " is not a array or list,could not use [] to get element");
        }
        Object indexValue = indexObject.getValue(env);
        if (!isInteger(indexValue)) {
            throw new IllegalArgumentException("Illegal index " + indexObject.desc(env));
View Full Code Here

TOP

Related Classes of com.googlecode.aviator.exception.ExpressionRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.