| 
 | JGraph X 2.1.0.7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mxgraph.util.svg.AbstractParser
public abstract class AbstractParser
This class is the superclass of all parsers. It provides localization and error handling methods.
| Field Summary | |
|---|---|
| static String | BUNDLE_CLASSNAMEThe default resource bundle base name. | 
| protected  int | currentThe current character. | 
| protected  ErrorHandler | errorHandlerThe error handler. | 
| protected  NormalizingReader | readerThe normalizing reader. | 
| Constructor Summary | |
|---|---|
| AbstractParser() | |
| Method Summary | |
|---|---|
| protected  String | createErrorMessage(String key,
                   Object[] args)Returns a localized error message. | 
| protected abstract  void | doParse()Method responsible for actually parsing data after AbstractParser has initialized itself. | 
| protected  String | getBundleClassName()Returns the resource bundle base name. | 
|  int | getCurrent()Returns the current character value. | 
|  void | parse(String s)Parses the given string. | 
| protected  void | reportCharacterExpectedError(char expectedChar,
                             int currentChar)simple api to call often reported error. | 
| protected  void | reportError(String key,
            Object[] args)Signals an error to the error handler. | 
| protected  void | reportUnexpectedCharacterError(int currentChar)simple api to call often reported error. | 
|  void | setErrorHandler(ErrorHandler handler)Allow an application to register an error event handler. | 
| protected  void | skipCommaSpaces()Skips the whitespaces and an optional comma. | 
| protected  void | skipSpaces()Skips the whitespaces in the current reader. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final String BUNDLE_CLASSNAME
protected ErrorHandler errorHandler
protected NormalizingReader reader
protected int current
| Constructor Detail | 
|---|
public AbstractParser()
| Method Detail | 
|---|
public int getCurrent()
public void setErrorHandler(ErrorHandler handler)
If the application does not register an error event handler, all error events reported by the parser will cause an exception to be thrown.
Applications may register a new or different handler in the middle of a parse, and the parser must begin using the new handler immediately.
setErrorHandler in interface Parserhandler - The error handler.
public void parse(String s)
           throws ParseException
parse in interface ParserParseException
protected abstract void doParse()
                         throws ParseException,
                                IOException
ParseException
IOException
protected void reportError(String key,
                           Object[] args)
                    throws ParseException
key - The message key in the resource bundle.args - The message arguments.
ParseException
protected void reportCharacterExpectedError(char expectedChar,
                                            int currentChar)
expectedChar - what caller expectedcurrentChar - what caller foundprotected void reportUnexpectedCharacterError(int currentChar)
currentChar - what the caller found and didnt expect
protected String createErrorMessage(String key,
                                    Object[] args)
key - The message key in the resource bundle.args - The message arguments.protected String getBundleClassName()
protected void skipSpaces()
                   throws IOException
IOException
protected void skipCommaSpaces()
                        throws IOException
IOException| 
 | JGraph X 2.1.0.7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||