public static String convertToGMonthDay(Object jsObject) throws AxisFault {
try {
// If the user returned a valid GMonthDay a s a String we use the converterUtil to
// validate it and return it back.
if (jsObject instanceof String) {
MonthDay monthDay = ConverterUtil.convertToGMonthDay((String)jsObject);
return ConverterUtil.convertToString(monthDay);
}
Date date = (Date) Context.jsToJava(jsObject, Date.class);
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.setTime(date);
MonthDay monthDay =
new MonthDay(calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH));
return ConverterUtil.convertToString(monthDay);
} catch (EvaluatorException e) {
throw new AxisFault("Unable to convert the return value to monthDay");
} catch (NumberFormatException e) {
throw new AxisFault("Unable to convert the return value to monthDay");