FileDocCategorySizeDatePackage
URISyntaxException.javaAPI DocAndroid 1.5 API4461Wed May 06 22:41:04 BST 2009java.net

URISyntaxException

public class URISyntaxException extends Exception
A {@code URISyntaxException} will be thrown if some information could not be parsed while creating a URI.
since
Android 1.0

Fields Summary
private static final long
serialVersionUID
private String
input
private int
index
Constructors Summary
public URISyntaxException(String input, String reason, int index)
Constructs a new {@code URISyntaxException} instance containing the string that caused the exception, a description of the problem and the index at which the error occurred.

param
input the string that caused the exception.
param
reason the reason why the exception occurred.
param
index the position where the exception occurred.
throws
NullPointerException if one of the arguments {@code input} or {@code reason} is {@code null}.
throws
IllegalArgumentException if the value for {@code index} is lesser than {@code -1}.
since
Android 1.0


                                                                                                                                                                
           
        super(reason);

        if (input == null || reason == null) {
            throw new NullPointerException();
        }

        if (index < -1) {
            throw new IllegalArgumentException();
        }

        this.input = input;
        this.index = index;
    
public URISyntaxException(String input, String reason)
Constructs a new {@code URISyntaxException} instance containing the string that caused the exception and a description of the problem.

param
input the string that caused the exception.
param
reason the reason why the exception occurred.
throws
NullPointerException if one of the arguments {@code input} or {@code reason} is {@code null}.
since
Android 1.0

        super(reason);

        if (input == null || reason == null) {
            throw new NullPointerException();
        }

        this.input = input;
        index = -1;
    
Methods Summary
public intgetIndex()
Gets the index at which the syntax error was found or {@code -1} if the index is unknown/unavailable.

return
the index of the syntax error.
since
Android 1.0

        return index;
    
public java.lang.StringgetInput()
Gets the initial string that contains an invalid syntax.

return
the string that caused the exception.
since
Android 1.0

        return input;
    
public java.lang.StringgetMessage()
Gets a description of the exception, including the reason, the string that caused the syntax error and the position of the syntax error if available.

return
a sting containing information about the exception.
see
java.lang.Throwable#getMessage()
since
Android 1.0

        String reason = super.getMessage();

        if (index != -1) {
            return Msg.getString("K0326", //$NON-NLS-1$
                    new String[] { reason, Integer.toString(index), input });
        }
        return Msg.getString("K0327", //$NON-NLS-1$
                new String[] { reason, input });
    
public java.lang.StringgetReason()
Gets a description of the syntax error.

return
the string describing the syntax error.
since
Android 1.0

        return super.getMessage();