public class REParserException extends ParserException
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.
Modifier and Type | Class and Description |
---|---|
static class |
REParserException.BeginGroupMismatch
a "begin group" has no matching "end group"
|
static class |
REParserException.BlockMismatch
a closing delimiter has no matching opening delimiter (see EnclosingExpression)
|
static class |
REParserException.EndGroupMismatch
a "end group" has no matching "begin group"
|
static class |
REParserException.EndOfPicture
the end of the picture environment was encoutered.
|
static class |
REParserException.EndOfPictureNotFound
the end of the picture environment wasn't found in the current Reader.
|
static class |
REParserException.EOF
the end of the file (or the underlying Reader) was reached abnormally, e.g.
|
static class |
REParserException.IncompleteSequence
signals an incomplete SequenceExpression
|
static class |
REParserException.NotFoundInFile
a mandatory expression wasn't found
|
static class |
REParserException.NumberFormat
aka NumberFormatException
|
static class |
REParserException.NumberSign
signals an error concerning the sign of a number (see NumericalExpression)
|
static class |
REParserException.SyntaxError
a syntax error has occured ; should be used as a last resort, when
no specific exception message applies.
|
ParserException.UnrecognizedFileFormat
Constructor and 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
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getLocalizedMessage()
Convenience call to getMessage()
|
java.lang.String |
getMessage()
Return a meaningfull, human-readable, properly localized description of this exception
|
java.lang.String |
toString()
Convenience call to getMessage()
|
localize
public REParserException(java.lang.String message, Context context)
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.public REParserException(java.lang.String message, Context context, AbstractRegularExpression expr)
context
- the Context used by the parser raising this exception ; merely serves as a document locator.public java.lang.String getMessage()
getMessage
in class ParserException
public java.lang.String toString()
toString
in class java.lang.Throwable
public java.lang.String getLocalizedMessage()
getLocalizedMessage
in class java.lang.Throwable
Submit a bug : syd@jpicedt.org