/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and * cannot be instantiated */ public Object newInstance(Object parent) throws IllegalStateException { return new GDay(); } //-- newInstance
/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and cannot be instantiated */ public Object newInstance(Object parent) throws IllegalStateException { return new GDay(); } // -- newInstance
/** * parse a String and convert it into a GDay. * @param str the string to parse * @return the Date represented by the string * @throws ParseException a parse exception is thrown if the string to parse * does not follow the rigth format (see the description * of this class) */ public static GDay parseGDay(String str) throws ParseException { GDay result = new GDay(); return parseGDayInternal(str, result); }
/** * parse a String and convert it into a GDay. * * @param str the string to parse * @return the Date represented by the string * @throws ParseException a parse exception is thrown if the string to parse does not follow the * rigth format (see the description of this class) */ public static GDay parseGDay(String str) throws ParseException { GDay result = new GDay(); return parseGDayInternal(str, result); }
private static GDay parseGDayInternal(String str, GDay result) throws ParseException { if (str == null) { throw new IllegalArgumentException("The string to be parsed must not be null."); } if (result == null) { result = new GDay(); } char[] chars = str.toCharArray(); if (chars[0] != '-' || chars[1] != '-' || chars[2] != '-') { throw new ParseException(BAD_GDAY+str+"\nA gDay must follow the pattern ---DD(Z|((+|-)hh:mm)).", 0); } int idx = 2; idx = parseDay(str, result, chars, idx, BAD_GDAY); parseTimeZone(str, result, chars, idx, BAD_GDAY); return result; } //parse
private static GDay parseGDayInternal(String str, GDay result) throws ParseException { if (str == null) { throw new IllegalArgumentException("The string to be parsed must not be null."); } if (result == null) { result = new GDay(); } char[] chars = str.toCharArray(); if (chars[0] != '-' || chars[1] != '-' || chars[2] != '-') { throw new ParseException( BAD_GDAY + str + "\nA gDay must follow the pattern ---DD(Z|((+|-)hh:mm)).", 0); } int idx = 2; idx = parseDay(str, result, chars, idx, BAD_GDAY); parseTimeZone(str, result, chars, idx, BAD_GDAY); return result; } // parse