/** * Returns a localized error message. * @param key The message key in the resource bundle. * @param args The message arguments. */ protected String createErrorMessage(String key, Object[] args) { try { return formatMessage(key, args); } catch (MissingResourceException e) { return key; } }
/** * simple api to call often reported error. * Just a wrapper for reportError(). * * @param expectedChar what caller expected * @param currentChar what caller found */ protected void reportCharacterExpectedError( char expectedChar, int currentChar ){ reportError("character.expected", new Object[] {expectedChar, currentChar}); }
/** * Parses the given reader */ public void parse(Reader r) throws ParseException { try { reader = new StreamNormalizingReader(r); doParse(); } catch (IOException e) { errorHandler.error (new ParseException (createErrorMessage("io.exception", null), e)); } }
/** * Signals an error to the error handler. * @param key The message key in the resource bundle. * @param args The message arguments. */ protected void reportError(String key, Object[] args) throws ParseException { errorHandler.error(new ParseException(createErrorMessage(key, args), reader.getLine(), reader.getColumn())); }
/** * Parses the given string. */ public void parse(String s) throws ParseException { try { reader = new StringNormalizingReader(s); doParse(); } catch (IOException e) { errorHandler.error (new ParseException (createErrorMessage("io.exception", null), e)); } }
/** * Signals an error to the error handler. * @param key The message key in the resource bundle. * @param args The message arguments. */ protected void reportError(String key, Object[] args) throws ParseException { errorHandler.error(new ParseException(createErrorMessage(key, args), reader.getLine(), reader.getColumn())); }
/** * Parses the given string. */ public void parse(String s) throws ParseException { try { reader = new StringNormalizingReader(s); doParse(); } catch (IOException e) { errorHandler.error (new ParseException (createErrorMessage("io.exception", null), e)); } }
/** * simple api to call often reported error. * Just a wrapper for reportError(). * * @param currentChar what the caller found and didnt expect */ protected void reportUnexpectedCharacterError( int currentChar ){ reportError("character.unexpected", new Object[] {currentChar}); }
/** * Returns a localized error message. * @param key The message key in the resource bundle. * @param args The message arguments. */ protected String createErrorMessage(String key, Object[] args) { try { return formatMessage(key, args); } catch (MissingResourceException e) { return key; } }
/** * Signals an error to the error handler. * @param key The message key in the resource bundle. * @param args The message arguments. */ protected void reportError(String key, Object[] args) throws ParseException { errorHandler.error(new ParseException(createErrorMessage(key, args), reader.getLine(), reader.getColumn())); }
/** * Parses the given reader */ public void parse(Reader r) throws ParseException { try { reader = new StreamNormalizingReader(r); doParse(); } catch (IOException e) { errorHandler.error (new ParseException (createErrorMessage("io.exception", null), e)); } }
/** * simple api to call often reported error. * Just a wrapper for reportError(). * * @param expectedChar what caller expected * @param currentChar what caller found */ protected void reportCharacterExpectedError( char expectedChar, int currentChar ){ reportError("character.expected", new Object[] {expectedChar, currentChar}); }
/** * Returns a localized error message. * @param key The message key in the resource bundle. * @param args The message arguments. */ protected String createErrorMessage(String key, Object[] args) { try { return formatMessage(key, args); } catch (MissingResourceException e) { return key; } }
/** * Parses the given string. */ public void parse(String s) throws ParseException { try { reader = new StringNormalizingReader(s); doParse(); } catch (IOException e) { errorHandler.error (new ParseException (createErrorMessage("io.exception", null), e)); } }
/** * simple api to call often reported error. * Just a wrapper for reportError(). * * @param currentChar what the caller found and didnt expect */ protected void reportUnexpectedCharacterError( int currentChar ){ reportError("character.unexpected", new Object[] {currentChar}); }
/** * Parses the given reader */ public void parse(Reader r) throws ParseException { try { reader = new StreamNormalizingReader(r); doParse(); } catch (IOException e) { errorHandler.error (new ParseException (createErrorMessage("io.exception", null), e)); } }
/** * simple api to call often reported error. * Just a wrapper for reportError(). * * @param currentChar what the caller found and didnt expect */ protected void reportUnexpectedCharacterError( int currentChar ){ reportError("character.unexpected", new Object[] { new Integer( currentChar ) }); }
/** * Parses the given input stream. If the encoding is null, * ISO-8859-1 is used. */ public void parse(InputStream is, String enc) throws ParseException { try { reader = new StreamNormalizingReader(is, enc); doParse(); } catch (IOException e) { errorHandler.error (new ParseException (createErrorMessage("io.exception", null), e)); } }
/** * simple api to call often reported error. * Just a wrapper for reportError(). * * @param expectedChar what caller expected * @param currentChar what caller found */ protected void reportCharacterExpectedError( char expectedChar, int currentChar ){ reportError("character.expected", new Object[] { new Character( expectedChar ), new Integer( currentChar ) }); }
/** * Parses the given input stream. If the encoding is null, * ISO-8859-1 is used. */ public void parse(InputStream is, String enc) throws ParseException { try { reader = new StreamNormalizingReader(is, enc); doParse(); } catch (IOException e) { errorHandler.error (new ParseException (createErrorMessage("io.exception", null), e)); } }