< prev index next >

src/java.base/share/classes/java/net/URISyntaxException.java

Print this page




  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.net;
  27 
  28 
  29 /**
  30  * Checked exception thrown to indicate that a string could not be parsed as a
  31  * URI reference.
  32  *
  33  * @author Mark Reinhold
  34  * @see URI
  35  * @since 1.4
  36  */
  37 
  38 public class URISyntaxException
  39     extends Exception
  40 {

  41     private static final long serialVersionUID = 2137979680897488891L;
  42 
  43     private String input;
  44     private int index;
  45 
  46     /**
  47      * Constructs an instance from the given input string, reason, and error
  48      * index.
  49      *
  50      * @param  input   The input string
  51      * @param  reason  A string explaining why the input could not be parsed
  52      * @param  index   The index at which the parse error occurred,
  53      *                 or {@code -1} if the index is not known
  54      *
  55      * @throws  NullPointerException
  56      *          If either the input or reason strings are {@code null}
  57      *
  58      * @throws  IllegalArgumentException
  59      *          If the error index is less than {@code -1}
  60      */




  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.net;
  27 
  28 
  29 /**
  30  * Checked exception thrown to indicate that a string could not be parsed as a
  31  * URI reference.
  32  *
  33  * @author Mark Reinhold
  34  * @see URI
  35  * @since 1.4
  36  */
  37 
  38 public class URISyntaxException
  39     extends Exception
  40 {
  41     @java.io.Serial
  42     private static final long serialVersionUID = 2137979680897488891L;
  43 
  44     private String input;
  45     private int index;
  46 
  47     /**
  48      * Constructs an instance from the given input string, reason, and error
  49      * index.
  50      *
  51      * @param  input   The input string
  52      * @param  reason  A string explaining why the input could not be parsed
  53      * @param  index   The index at which the parse error occurred,
  54      *                 or {@code -1} if the index is not known
  55      *
  56      * @throws  NullPointerException
  57      *          If either the input or reason strings are {@code null}
  58      *
  59      * @throws  IllegalArgumentException
  60      *          If the error index is less than {@code -1}
  61      */


< prev index next >