Best code examples for Java 8 ParseException class (java.text.ParseException)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ParseException class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Java 8 ParseException examples from Open Source projects
This code example shows how to use the following methods:
    } 
 
    @Test(expected = ParseException.class) 
    public void should_notify_all_listeners_when_called_delegate_handler_throws_exception_and_rethrow_it() throws Throwable { 
        // given 
        ParseException parseException = new ParseException("", 0); 
        given(mockHandler.handle(invocation)).willThrow(parseException); 
 
        // when 
        try { 
            notifier.handle(invocation); 
            fail(); 
        } finally { 
            // then 
            verify(listener1).reportInvocation(new NotifiedMethodInvocationReport(invocation, parseException)); 
            verify(listener2).reportInvocation(new NotifiedMethodInvocationReport(invocation, parseException)); 
        } 
    } 
 
    @Test 
    public void should_report_listener_exception() throws Throwable { 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
            iso8601String = iso8601String.replace("Z", "+00:00"); //$NON-NLS-1$ //$NON-NLS-2$
            try { 
                iso8601String = iso8601String.substring(0, 22) + iso8601String.substring(23);
            } catch (IndexOutOfBoundsException e) {
                e.printStackTrace();
                throw new ParseException("Invalid ISO 8601 length for string " + iso8601String, 0); //$NON-NLS-1$
            } 
            formatString = "yyyy-MM-dd'T'HH:mm:ssZ"; //$NON-NLS-1$
        } else { 
            formatString = "yyyy-MM-dd"; //$NON-NLS-1$
        } 
 
        Date result = new SimpleDateFormat(formatString).parse(iso8601String);
        return result.getTime();
    } 
 
    public static String timeToIso8601(long time, boolean includeTime) {
        if (time == 0)
            return null; 
        Date date = new Date(time);
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMessage
 
			Date date = iso8601.toDate(value);
 
			return date;
		} catch (ParseException e) {
			throw new ConversionError("Error to convert Date: "	+ e.getMessage());
		} 
	} 
} 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMessage
 
			Calendar calendar = iso8601.toCalendar(value);
 
			return calendar;
		} catch (ParseException e) {
			throw new ConversionError("Error to convert Calendar: "	+ e.getMessage());
		} 
	} 
} 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
    return cursor;
  } 
 
  public OJSONReader checkContent(final String iExpected) throws ParseException {
    if (!value.equals(iExpected))
      throw new ParseException("Expected content is " + iExpected + " but found " + value, cursor);
    return this;
  } 
 
  public boolean isContent(final String iExpected) {
    return value.equals(iExpected);
  } 
 
  public int readInteger(final char[] iUntil) throws IOException, ParseException {
    return readNumber(iUntil, false);
  } 
 
  public int readNumber(final char[] iUntil, final boolean iInclude) throws IOException, ParseException {
    if (readNext(iUntil, iInclude) == null)
      throw new ParseException("Expected integer", cursor);
Full Snippet Info
6
CodeRank
Related Java 8 ParseException Questions & Answers: