PatternSyntaxException


PatternSyntaxException java.util.regex

Java 1.4 serializable unchecked

Signals a syntax error in the text representation of a regular expression. An exception of this type may be thrown by the Pattern.compile( ) and Pattern.matches( ) methods , and also by the String matches( ) , replaceFirst( ) , replaceAll( ) and split( ) methods which call those Pattern methods.

getPattern( ) returns the text that contained the syntax error, and getIndex( ) returns the approximate location of the error within that text, or -1, if the location is not known. geTDescription( ) returns an error message that provides further detail about the error. The inherited getMessage( ) method combines the information provided by these other three methods into a single multiline message.

Figure 16-133. java.util.regex.PatternSyntaxException

 public class  PatternSyntaxException  extends IllegalArgumentException {  // Public Constructors  public  PatternSyntaxException  (String  desc  , String  regex  , int  index  );  // Public Instance Methods  public String  getDescription  ( );        public int  getIndex  ( );        public String  getPattern  ( );  // Public Methods Overriding Throwable  public String  getMessage  ( );   } 



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net