Package jpicedt.format.input.util
Class REParserException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- jpicedt.graphic.io.parser.ParserException
-
- jpicedt.format.input.util.REParserException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
REParserException.BeginGroupMismatch,REParserException.BlockMismatch,REParserException.EndGroupMismatch,REParserException.EndOfPicture,REParserException.EndOfPictureNotFound,REParserException.EOF,REParserException.IncompleteSequence,REParserException.NotFoundInFile,REParserException.NumberFormat,REParserException.NumberSign,REParserException.SyntaxError
public class REParserException extends ParserException
An Exception manager to be used by RE-parsers (i.e. those built on top of AbstractRegularExpression's).The main purpose is to build a meaningfull string so that the user may be able to precisely locate the source of the syntax error and what kind of error it is.
See also: key-entries starting with "parser-exception" in jpicedt/lang/i18n_xx.properties resource files.
[Developpers] : new exceptions should be implemented as inner static classes so as to reduce namespace pollution. Simply inherit your class from REParserException, feeding the mother-class constructor with a key-entry string of your choice, then add an appropriate key/value pair in EACH jpicedt/lang.i18n_xx.properties resource file.
- Since:
- jpicedt 1.3
- Version:
- $Id: REParserException.java,v 1.7.2.1 2007/09/02 11:56:14 reynal Exp $
- Author:
- Sylvain Reynal
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classREParserException.BeginGroupMismatcha "begin group" has no matching "end group"static classREParserException.BlockMismatcha closing delimiter has no matching opening delimiter (see EnclosingExpression)static classREParserException.EndGroupMismatcha "end group" has no matching "begin group"static classREParserException.EndOfPicturethe end of the picture environment was encoutered.static classREParserException.EndOfPictureNotFoundthe end of the picture environment wasn't found in the current Reader.static classREParserException.EOFthe end of the file (or the underlying Reader) was reached abnormally, e.g.static classREParserException.IncompleteSequencesignals an incomplete SequenceExpressionstatic classREParserException.NotFoundInFilea mandatory expression wasn't foundstatic classREParserException.NumberFormataka NumberFormatExceptionstatic classREParserException.NumberSignsignals an error concerning the sign of a number (see NumericalExpression)static classREParserException.SyntaxErrora syntax error has occured ; should be used as a last resort, when no specific exception message applies.-
Nested classes/interfaces inherited from class jpicedt.graphic.io.parser.ParserException
ParserException.UnrecognizedFileFormat
-
-
Constructor Summary
Constructors Constructor Description REParserException(java.lang.String message, Context context)create a new REParserException with the specified error code and line number.REParserException(java.lang.String message, Context context, AbstractRegularExpression expr)create a new REParserException, raised by the given Expression
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetLocalizedMessage()Convenience call to getMessage()java.lang.StringgetMessage()Return a meaningfull, human-readable, properly localized description of this exceptionjava.lang.StringtoString()Convenience call to getMessage()-
Methods inherited from class jpicedt.graphic.io.parser.ParserException
localize
-
-
-
-
Constructor Detail
-
REParserException
public REParserException(java.lang.String message, Context context)create a new REParserException with the specified error code and line number.- Parameters:
message- used for localization purpose ; this should be a key-entry in the current set of jpicedt/lang/i18n_xx.properties resource files, with the corresponding value being a properly localized message.
-
REParserException
public REParserException(java.lang.String message, Context context, AbstractRegularExpression expr)create a new REParserException, raised by the given Expression- Parameters:
context- the Context used by the parser raising this exception ; merely serves as a document locator.
-
-
Method Detail
-
getMessage
public java.lang.String getMessage()
Return a meaningfull, human-readable, properly localized description of this exception- Overrides:
getMessagein classParserException
-
toString
public java.lang.String toString()
Convenience call to getMessage()- Overrides:
toStringin classjava.lang.Throwable
-
getLocalizedMessage
public java.lang.String getLocalizedMessage()
Convenience call to getMessage()- Overrides:
getLocalizedMessagein classjava.lang.Throwable
-
-