java.util.regex
Class PatternSyntaxException

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.lang.Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable 
      extended by java.lang.Exception sample code for java.lang.Exception definition code for java.lang.Exception 
          extended by java.lang.RuntimeException sample code for java.lang.RuntimeException definition code for java.lang.RuntimeException 
              extended by java.lang.IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException 
                  extended by java.util.regex.PatternSyntaxException
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class PatternSyntaxException
extends IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException

Unchecked exception thrown to indicate a syntax error in a regular-expression pattern.

Since:
1.4
See Also:
Serialized Form

Constructor Summary
PatternSyntaxException sample code for java.util.regex.PatternSyntaxException.PatternSyntaxException(java.lang.String, java.lang.String, int) definition code for java.util.regex.PatternSyntaxException.PatternSyntaxException(java.lang.String, java.lang.String, int) (String sample code for java.lang.String definition code for java.lang.String  desc, String sample code for java.lang.String definition code for java.lang.String  regex, int index)
          Constructs a new instance of this class.
 
Method Summary
 String sample code for java.lang.String definition code for java.lang.String getDescription sample code for java.util.regex.PatternSyntaxException.getDescription() definition code for java.util.regex.PatternSyntaxException.getDescription() ()
          Retrieves the description of the error.
 int getIndex sample code for java.util.regex.PatternSyntaxException.getIndex() definition code for java.util.regex.PatternSyntaxException.getIndex() ()
          Retrieves the error index.
 String sample code for java.lang.String definition code for java.lang.String getMessage sample code for java.util.regex.PatternSyntaxException.getMessage() definition code for java.util.regex.PatternSyntaxException.getMessage() ()
          Returns a multi-line string containing the description of the syntax error and its index, the erroneous regular-expression pattern, and a visual indication of the error index within the pattern.
 String sample code for java.lang.String definition code for java.lang.String getPattern sample code for java.util.regex.PatternSyntaxException.getPattern() definition code for java.util.regex.PatternSyntaxException.getPattern() ()
          Retrieves the erroneous regular-expression pattern.
 
Methods inherited from class java.lang.Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable
fillInStackTrace sample code for java.lang.Throwable.fillInStackTrace() definition code for java.lang.Throwable.fillInStackTrace() , getCause sample code for java.lang.Throwable.getCause() definition code for java.lang.Throwable.getCause() , getLocalizedMessage sample code for java.lang.Throwable.getLocalizedMessage() definition code for java.lang.Throwable.getLocalizedMessage() , getStackTrace sample code for java.lang.Throwable.getStackTrace() definition code for java.lang.Throwable.getStackTrace() , initCause sample code for java.lang.Throwable.initCause(java.lang.Throwable) definition code for java.lang.Throwable.initCause(java.lang.Throwable) , printStackTrace sample code for java.lang.Throwable.printStackTrace() definition code for java.lang.Throwable.printStackTrace() , printStackTrace sample code for java.lang.Throwable.printStackTrace(java.io.PrintStream) definition code for java.lang.Throwable.printStackTrace(java.io.PrintStream) , printStackTrace sample code for java.lang.Throwable.printStackTrace(java.io.PrintWriter) definition code for java.lang.Throwable.printStackTrace(java.io.PrintWriter) , setStackTrace sample code for java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[]) definition code for java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[]) , toString sample code for java.lang.Throwable.toString() definition code for java.lang.Throwable.toString()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

PatternSyntaxException sample code for java.util.regex.PatternSyntaxException(java.lang.String, java.lang.String, int) definition code for java.util.regex.PatternSyntaxException(java.lang.String, java.lang.String, int)

public PatternSyntaxException(String sample code for java.lang.String definition code for java.lang.String  desc,
                              String sample code for java.lang.String definition code for java.lang.String  regex,
                              int index)
Constructs a new instance of this class.

Parameters:
desc - A description of the error
regex - The erroneous pattern
index - The approximate index in the pattern of the error, or -1 if the index is not known
Method Detail

getIndex sample code for java.util.regex.PatternSyntaxException.getIndex() definition code for java.util.regex.PatternSyntaxException.getIndex()

public int getIndex()
Retrieves the error index.

Returns:
The approximate index in the pattern of the error, or -1 if the index is not known

getDescription sample code for java.util.regex.PatternSyntaxException.getDescription() definition code for java.util.regex.PatternSyntaxException.getDescription()

public String sample code for java.lang.String definition code for java.lang.String  getDescription()
Retrieves the description of the error.

Returns:
The description of the error

getPattern sample code for java.util.regex.PatternSyntaxException.getPattern() definition code for java.util.regex.PatternSyntaxException.getPattern()

public String sample code for java.lang.String definition code for java.lang.String  getPattern()
Retrieves the erroneous regular-expression pattern.

Returns:
The erroneous pattern

getMessage sample code for java.util.regex.PatternSyntaxException.getMessage() definition code for java.util.regex.PatternSyntaxException.getMessage()

public String sample code for java.lang.String definition code for java.lang.String  getMessage()
Returns a multi-line string containing the description of the syntax error and its index, the erroneous regular-expression pattern, and a visual indication of the error index within the pattern.

Overrides:
getMessage sample code for java.lang.Throwable.getMessage() definition code for java.lang.Throwable.getMessage() in class Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable
Returns:
The full detail message