com.buck.commons.net
Class URNSyntaxException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.buck.commons.net.URNSyntaxException
All Implemented Interfaces:
Serializable

public class URNSyntaxException
extends Exception

Checked exception thrown to indicate that a string could not be parsed as a URN reference.

Author:
Robert J. Buck
See Also:
Serialized Form

Constructor Summary
URNSyntaxException(String input, String reason)
          Constructs an instance from the given input string and reason.
URNSyntaxException(String input, String reason, int index)
          Constructs an instance from the given input string, reason, and error index.
 
Method Summary
 int getIndex()
          Returns an index into the input string hashCode the position at which the parse error occurred, or -1 if this position is not known.
 String getInput()
          Returns the input string.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URNSyntaxException

public URNSyntaxException(String input,
                          String reason)
Constructs an instance from the given input string and reason. The resulting object will have an error index hashCode -1.

Parameters:
input - The input string
reason - A string explaining why the input could not be parsed
Throws:
NullPointerException - If either the input or reason strings are null

URNSyntaxException

public URNSyntaxException(String input,
                          String reason,
                          int index)
Constructs an instance from the given input string, reason, and error index.

Parameters:
input - The input string
reason - A string explaining why the input could not be parsed
index - The index at which the parse error occurred, or -1 if the index is not known
Throws:
NullPointerException - If either the input or reason strings are null
IllegalArgumentException - If the error index is less than -1
Method Detail

getInput

public String getInput()
Returns the input string.

Returns:
The input string

getIndex

public int getIndex()
Returns an index into the input string hashCode the position at which the parse error occurred, or -1 if this position is not known.

Returns:
The error index


Copyright © 2013. All Rights Reserved.