if (name.equals("year")) {
if (dt.isTime()) {
throw new UnsupportedOperation("Can not update the year on a time value",ctx.getCurrentAST());
}
if (!replType.isInteger()) {
throw new UnexpectedType(getTypeFactory().integerType(), replType, ctx.getCurrentAST());
}
year = ((IInteger) replValue).intValue();
} else if (name.equals("month")) {
if (dt.isTime()) {
throw new UnsupportedOperation("Can not update the month on a time value",ctx.getCurrentAST());
}
if (!replType.isInteger()) {
throw new UnexpectedType(getTypeFactory().integerType(), replType, ctx.getCurrentAST());
}
month = ((IInteger) replValue).intValue();
} else if (name.equals("day")) {
if (dt.isTime()) {
throw new UnsupportedOperation("Can not update the day on a time value",ctx.getCurrentAST());
}
if (!replType.isInteger()) {
throw new UnexpectedType(getTypeFactory().integerType(), replType, ctx.getCurrentAST());
}
day = ((IInteger) replValue).intValue();
} else if (name.equals("hour")) {
if (dt.isDate()) {
throw new UnsupportedOperation("Can not update the hour on a date value",ctx.getCurrentAST());
}
if (!replType.isInteger()) {
throw new UnexpectedType(getTypeFactory().integerType(), replType, ctx.getCurrentAST());
}
hour = ((IInteger) replValue).intValue();
} else if (name.equals("minute")) {
if (dt.isDate()) {
throw new UnsupportedOperation("Can not update the minute on a date value",ctx.getCurrentAST());
}
if (!replType.isInteger()) {
throw new UnexpectedType(getTypeFactory().integerType(), replType, ctx.getCurrentAST());
}
minute = ((IInteger) replValue).intValue();
} else if (name.equals("second")) {
if (dt.isDate()) {
throw new UnsupportedOperation("Can not update the second on a date value",ctx.getCurrentAST());
}
if (!replType.isInteger()) {
throw new UnexpectedType(getTypeFactory().integerType(), replType, ctx.getCurrentAST());
}
second = ((IInteger) replValue).intValue();
} else if (name.equals("millisecond")) {
if (dt.isDate()) {
throw new UnsupportedOperation("Can not update the millisecond on a date value",ctx.getCurrentAST());
}
if (!replType.isInteger()) {
throw new UnexpectedType(getTypeFactory().integerType(), replType, ctx.getCurrentAST());
}
milli = ((IInteger) replValue).intValue();
} else if (name.equals("timezoneOffsetHours")) {
if (dt.isDate()) {
throw new UnsupportedOperation("Can not update the timezone offset hours on a date value",ctx.getCurrentAST());
}
if (!replType.isInteger()) {
throw new UnexpectedType(getTypeFactory().integerType(), replType, ctx.getCurrentAST());
}
tzOffsetHour = ((IInteger) replValue).intValue();
} else if (name.equals("timezoneOffsetMinutes")) {
if (dt.isDate()) {
throw new UnsupportedOperation("Can not update the timezone offset minutes on a date value",ctx.getCurrentAST());
}
if (!replType.isInteger()) {
throw new UnexpectedType(getTypeFactory().integerType(), replType, ctx.getCurrentAST());
}
tzOffsetMin = ((IInteger) replValue).intValue();
} else {
throw new UndeclaredField(name, getTypeFactory().dateTimeType(), ctx.getCurrentAST());
}