Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| http://www.jpicedt.org
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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:
  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
`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.

Nested classes inherited from class jpicedt.graphic.io.parser.ParserException
`ParserException.UnrecognizedFileFormat`

Constructor Summary
`REParserException(String message, Context context)` create a new REParserException with the specified error code and line number.
`REParserException(String message, Context context, AbstractRegularExpression expr)` create a new REParserException, raised by the given Expression

Method Summary
`String` | `getLocalizedMessage()` Convenience call to getMessage()
`String` | `getMessage()` Return a meaningfull, human-readable, properly localized description of this exception
`String` | `toString()` Convenience call to getMessage()

Methods inherited from class jpicedt.graphic.io.parser.ParserException
`localize`

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### REParserException

    public REParserException(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(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 String getMessage()

  Return a meaningfull, human-readable, properly localized description of this exception

  Overrides:
    `getMessage` in class `ParserException`

### toString

    public String toString()

  Convenience call to getMessage()

### getLocalizedMessage

    public String getLocalizedMessage()

  Convenience call to getMessage()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| http://www.jpicedt.org
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug : syd@jpicedt.org