< prev index next >

src/java.base/share/classes/java/time/format/DateTimeParseException.java

Print this page




  61  */
  62 package java.time.format;
  63 
  64 import java.time.DateTimeException;
  65 
  66 /**
  67  * An exception thrown when an error occurs during parsing.
  68  * <p>
  69  * This exception includes the text being parsed and the error index.
  70  *
  71  * @implSpec
  72  * This class is intended for use in a single thread.
  73  *
  74  * @since 1.8
  75  */
  76 public class DateTimeParseException extends DateTimeException {
  77 
  78     /**
  79      * Serialization version.
  80      */

  81     private static final long serialVersionUID = 4304633501674722597L;
  82 
  83     /**
  84      * The text that was being parsed.
  85      */
  86     private final String parsedString;
  87     /**
  88      * The error index in the text.
  89      */
  90     private final int errorIndex;
  91 
  92     /**
  93      * Constructs a new exception with the specified message.
  94      *
  95      * @param message  the message to use for this exception, may be null
  96      * @param parsedData  the parsed text, should not be null
  97      * @param errorIndex  the index in the parsed string that was invalid, should be a valid index
  98      */
  99     public DateTimeParseException(String message, CharSequence parsedData, int errorIndex) {
 100         super(message);




  61  */
  62 package java.time.format;
  63 
  64 import java.time.DateTimeException;
  65 
  66 /**
  67  * An exception thrown when an error occurs during parsing.
  68  * <p>
  69  * This exception includes the text being parsed and the error index.
  70  *
  71  * @implSpec
  72  * This class is intended for use in a single thread.
  73  *
  74  * @since 1.8
  75  */
  76 public class DateTimeParseException extends DateTimeException {
  77 
  78     /**
  79      * Serialization version.
  80      */
  81     @java.io.Serial
  82     private static final long serialVersionUID = 4304633501674722597L;
  83 
  84     /**
  85      * The text that was being parsed.
  86      */
  87     private final String parsedString;
  88     /**
  89      * The error index in the text.
  90      */
  91     private final int errorIndex;
  92 
  93     /**
  94      * Constructs a new exception with the specified message.
  95      *
  96      * @param message  the message to use for this exception, may be null
  97      * @param parsedData  the parsed text, should not be null
  98      * @param errorIndex  the index in the parsed string that was invalid, should be a valid index
  99      */
 100     public DateTimeParseException(String message, CharSequence parsedData, int errorIndex) {
 101         super(message);


< prev index next >