org.apache.batik.parser
public abstract class AbstractParser extends Object implements Parser
Field Summary | |
---|---|
static String | BUNDLE_CLASSNAME
The default resource bundle base name. |
protected int | current
The current character. |
protected ErrorHandler | errorHandler
The error handler. |
protected LocalizableSupport | localizableSupport
The localizable support. |
protected NormalizingReader | reader
The normalizing reader. |
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. |
String | formatMessage(String key, Object[] args)
Implements (String,Object[]) . |
protected String | getBundleClassName()
Returns the resource bundle base name. |
int | getCurrent()
Returns the current character value. |
Locale | getLocale()
Implements getLocale. |
void | parse(Reader r)
Parses the given reader |
void | parse(InputStream is, String enc)
Parses the given input stream. |
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.
|
void | setLocale(Locale l)
Implements setLocale. |
protected void | skipCommaSpaces()
Skips the whitespaces and an optional comma. |
protected void | skipSpaces()
Skips the whitespaces in the current reader. |
Parameters: key The message key in the resource bundle. args The message arguments.
(String,Object[])
.Returns: BUNDLE_CLASSNAME.
Parameters: expectedChar what caller expected currentChar what caller found
Parameters: key The message key in the resource bundle. args The message arguments.
Parameters: currentChar what the caller found and didnt expect
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.
Parameters: handler The error handler.