private void parseMonth() throws ParseException { if ( upGeneralizedTime.length() < 6 ) { throw new ParseException( I18n.err( I18n.ERR_17064_TIME_TO_SHORT_MISSING_MONTH ), 4 ); } try { int month = Strings.parseInt( upGeneralizedTime.substring( 4, 6 ) ); calendar.set( Calendar.MONTH, month - 1 ); } catch ( NumberFormatException e ) { throw new ParseException( I18n.err( I18n.ERR_17065_MONTH_NOT_NUM ), 4 ); } }
private void parseYear() throws ParseException { if ( upGeneralizedTime.length() < 4 ) { throw new ParseException( I18n.err( I18n.ERR_17066_TIME_TO_SHORT_MISSING_YEAR ), 0 ); } try { int year = Strings.parseInt( upGeneralizedTime.substring( 0, 4 ) ); calendar.set( Calendar.YEAR, year ); } catch ( NumberFormatException e ) { throw new ParseException( I18n.err( I18n.ERR_17067_YEAR_NOT_NUM ), 0 ); } }
private void parseYear() throws ParseException { if ( upGeneralizedTime.length() < 4 ) { throw new ParseException( I18n.err( I18n.ERR_17066_TIME_TO_SHORT_MISSING_YEAR ), 0 ); } try { int year = Strings.parseInt( upGeneralizedTime.substring( 0, 4 ) ); calendar.set( Calendar.YEAR, year ); } catch ( NumberFormatException e ) { throw new ParseException( I18n.err( I18n.ERR_17067_YEAR_NOT_NUM ), 0 ); } }
private void parseDay() throws ParseException { if ( upGeneralizedTime.length() < 8 ) { throw new ParseException( I18n.err( I18n.ERR_17062_TIME_TO_SHORT_MISSING_DAY ), 6 ); } try { int day = Strings.parseInt( upGeneralizedTime.substring( 6, 8 ) ); calendar.set( Calendar.DAY_OF_MONTH, day ); } catch ( NumberFormatException e ) { throw new ParseException( I18n.err( I18n.ERR_17063_DAY_NOT_NUM ), 6 ); } }
private void parseSecond() throws ParseException { // read minute if ( upGeneralizedTime.length() < 14 ) { throw new ParseException( I18n.err( I18n.ERR_17056_TIME_TOO_SHORT_NO_SECOND ), 12 ); } try { int second = Strings.parseInt( upGeneralizedTime.substring( 12, 14 ) ); calendar.set( Calendar.SECOND, second ); } catch ( NumberFormatException e ) { throw new ParseException( I18n.err( I18n.ERR_17057_SECOND_NOT_NUM ), 12 ); } }
private void parseMinute() throws ParseException { // read minute if ( upGeneralizedTime.length() < 12 ) { throw new ParseException( I18n.err( I18n.ERR_17058_MISSING_MINUTE ), 10 ); } try { int minute = Strings.parseInt( upGeneralizedTime.substring( 10, 12 ) ); calendar.set( Calendar.MINUTE, minute ); } catch ( NumberFormatException e ) { throw new ParseException( I18n.err( I18n.ERR_17059_MIN_NOT_NUM ), 10 ); } }
private void parseSecond() throws ParseException { // read minute if ( upGeneralizedTime.length() < 14 ) { throw new ParseException( I18n.err( I18n.ERR_17056_TIME_TOO_SHORT_NO_SECOND ), 12 ); } try { int second = Strings.parseInt( upGeneralizedTime.substring( 12, 14 ) ); calendar.set( Calendar.SECOND, second ); } catch ( NumberFormatException e ) { throw new ParseException( I18n.err( I18n.ERR_17057_SECOND_NOT_NUM ), 12 ); } }
private void parseHour() throws ParseException { if ( upGeneralizedTime.length() < 10 ) { throw new ParseException( I18n.err( I18n.ERR_17060_TIME_TO_SHORT_MISSING_HOUR ), 8 ); } try { int hour = Strings.parseInt( upGeneralizedTime.substring( 8, 10 ) ); calendar.set( Calendar.HOUR_OF_DAY, hour ); } catch ( NumberFormatException e ) { throw new ParseException( I18n.err( I18n.ERR_17061_HOUR_NOT_NUM ), 8 ); } }
private void parseDay() throws ParseException { if ( upGeneralizedTime.length() < 8 ) { throw new ParseException( I18n.err( I18n.ERR_17062_TIME_TO_SHORT_MISSING_DAY ), 6 ); } try { int day = Strings.parseInt( upGeneralizedTime.substring( 6, 8 ) ); calendar.set( Calendar.DAY_OF_MONTH, day ); } catch ( NumberFormatException e ) { throw new ParseException( I18n.err( I18n.ERR_17063_DAY_NOT_NUM ), 6 ); } }
private void parseMonth() throws ParseException { if ( upGeneralizedTime.length() < 6 ) { throw new ParseException( I18n.err( I18n.ERR_17064_TIME_TO_SHORT_MISSING_MONTH ), 4 ); } try { int month = Strings.parseInt( upGeneralizedTime.substring( 4, 6 ) ); calendar.set( Calendar.MONTH, month - 1 ); } catch ( NumberFormatException e ) { throw new ParseException( I18n.err( I18n.ERR_17065_MONTH_NOT_NUM ), 4 ); } }
private void parseHour() throws ParseException { if ( upGeneralizedTime.length() < 10 ) { throw new ParseException( I18n.err( I18n.ERR_17060_TIME_TO_SHORT_MISSING_HOUR ), 8 ); } try { int hour = Strings.parseInt( upGeneralizedTime.substring( 8, 10 ) ); calendar.set( Calendar.HOUR_OF_DAY, hour ); } catch ( NumberFormatException e ) { throw new ParseException( I18n.err( I18n.ERR_17061_HOUR_NOT_NUM ), 8 ); } }
private void parseMinute() throws ParseException { // read minute if ( upGeneralizedTime.length() < 12 ) { throw new ParseException( I18n.err( I18n.ERR_17058_MISSING_MINUTE ), 10 ); } try { int minute = Strings.parseInt( upGeneralizedTime.substring( 10, 12 ) ); calendar.set( Calendar.MINUTE, minute ); } catch ( NumberFormatException e ) { throw new ParseException( I18n.err( I18n.ERR_17059_MIN_NOT_NUM ), 10 ); } }