Java Code Examples for java.text.ParseException.toString()

The following are Jave code examples for showing how to use toString() of the java.text.ParseException class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: boohee_v5.6   File: CalendarParsedResult.java   View Source Code Vote up 5 votes
public CalendarParsedResult(String summary, String startString, String endString, String
        durationString, String location, String organizer, String[] attendees, String
        description, double latitude, double longitude) {
    super(ParsedResultType.CALENDAR);
    this.summary = summary;
    try {
        this.start = parseDate(startString);
        if (endString == null) {
            long durationMS = parseDurationMS(durationString);
            this.end = durationMS < 0 ? null : new Date(this.start.getTime() + durationMS);
        } else {
            try {
                this.end = parseDate(endString);
            } catch (ParseException pe) {
                throw new IllegalArgumentException(pe.toString());
            }
        }
        this.startAllDay = startString.length() == 8;
        boolean z = endString != null && endString.length() == 8;
        this.endAllDay = z;
        this.location = location;
        this.organizer = organizer;
        this.attendees = attendees;
        this.description = description;
        this.latitude = latitude;
        this.longitude = longitude;
    } catch (ParseException pe2) {
        throw new IllegalArgumentException(pe2.toString());
    }
}
 
Example 2
Project: sbc-qsystem   File: FScheduleChangeDialod.java   View Source Code Vote up 5 votes
private void saveSchedule() {
    schedule.setName(textFieldPlaneName.getText());
    schedule.setType(radioButtonWeek.isSelected() ? 0 : 1);
    try {
        schedule
            .setTime_begin_1(c1.isSelected() ? Uses.FORMAT_HH_MM.parse(s1.getText()) : null);
        schedule.setTime_end_1(c1.isSelected() ? Uses.FORMAT_HH_MM.parse(e1.getText()) : null);
        schedule
            .setTime_begin_2(c2.isSelected() ? Uses.FORMAT_HH_MM.parse(s2.getText()) : null);
        schedule.setTime_end_2(c2.isSelected() ? Uses.FORMAT_HH_MM.parse(e2.getText()) : null);
        schedule
            .setTime_begin_3(c3.isSelected() ? Uses.FORMAT_HH_MM.parse(s3.getText()) : null);
        schedule.setTime_end_3(c3.isSelected() ? Uses.FORMAT_HH_MM.parse(e3.getText()) : null);
        schedule
            .setTime_begin_4(c4.isSelected() ? Uses.FORMAT_HH_MM.parse(s4.getText()) : null);
        schedule.setTime_end_4(c4.isSelected() ? Uses.FORMAT_HH_MM.parse(e4.getText()) : null);
        schedule
            .setTime_begin_5(c5.isSelected() ? Uses.FORMAT_HH_MM.parse(s5.getText()) : null);
        schedule.setTime_end_5(c5.isSelected() ? Uses.FORMAT_HH_MM.parse(e5.getText()) : null);
        schedule
            .setTime_begin_6(c6.isSelected() ? Uses.FORMAT_HH_MM.parse(s6.getText()) : null);
        schedule.setTime_end_6(c6.isSelected() ? Uses.FORMAT_HH_MM.parse(e6.getText()) : null);
        schedule
            .setTime_begin_7(c7.isSelected() ? Uses.FORMAT_HH_MM.parse(s7.getText()) : null);
        schedule.setTime_end_7(c7.isSelected() ? Uses.FORMAT_HH_MM.parse(e7.getText()) : null);

        schedule.setBreaks_1((QBreaks) cb1.getSelectedItem());
        schedule.setBreaks_2((QBreaks) cb2.getSelectedItem());
        schedule.setBreaks_3((QBreaks) cb3.getSelectedItem());
        schedule.setBreaks_4((QBreaks) cb4.getSelectedItem());
        schedule.setBreaks_5((QBreaks) cb5.getSelectedItem());
        schedule.setBreaks_6((QBreaks) cb6.getSelectedItem());
        schedule.setBreaks_7((QBreaks) cb7.getSelectedItem());
    } catch (ParseException ex) {
        throw new ServerException(ex.toString());
    }
}