}
}
Expr expr = attributes.get(attrName.toLowerCase());
if (expr instanceof Constant) {
Constant co = (Constant) expr;
if (exprType == Expr.INTEGER) {
try {
return new Integer(co.intValue()); // Integer Value
} catch (Throwable ex) {
throw new Exception("wrong type (expected type: integer)");
}
} else if (exprType == Expr.BOOLEAN) {
try {
return new Boolean(co.isTrue()); // Boolean Value
} catch (Throwable ex) {
throw new Exception("wrong type (expected type: boolean)");
}
} else if (exprType == Expr.REAL) {
return new Double(co.realValue()); // Real Value
} else if (exprType == Expr.STRING) {
String result = co.stringValue();
if (result != null) {
if (result.startsWith("\"") && result.endsWith("\"")) {
result = result.substring(1, result.length() - 1);
} else if (result.length() == 0) {