Package java.text

Examples of java.text.ParseException.initCause()


     
      // final synset in the file
      addInternal(synset, synsetSize);
    } catch (IllegalArgumentException e) {
      ParseException ex = new ParseException("Invalid synonym rule at line " + br.getLineNumber(), 0);
      ex.initCause(e);
      throw ex;
    } finally {
      br.close();
    }
  }
View Full Code Here


                throw StrictParseException.make(e, string);
            }
            catch (NumberFormatException e) {
                ParseException parseException =
                    makeParseException(NumberFormatErrorKey, 1);
                parseException.initCause(e);
                throw StrictParseException.make(parseException, string);
            }
        }

        private static void assertStrict (DecimalParseInfo info)
View Full Code Here

            if (qs < 0)
                throw new ParseException("The quality source (qs) value, " + v + ", must be non-negative number", 0);
            return qs;
        } catch (NumberFormatException ex) {
            ParseException pe = new ParseException("The quality source (qs) value, " + v + ", is not a valid value", 0);
            pe.initCause(ex);
            throw pe;
        }
    }
}
View Full Code Here

        try {
            return Integer.parseInt(reader.nextToken());
        } catch (NumberFormatException nfe) {
            ParseException pe = new ParseException(
                    "Error parsing integer value for " + directiveName + " directive", index);
            pe.initCause(nfe);
            throw pe;
        }
    }

    private void readDirective(CacheControl cacheControl,
View Full Code Here

    protected abstract T invoke(String input) throws Exception;
  }

  public static ParseException newParseException(String message, Throwable cause) {
    ParseException pe = newParseException(message);
    pe.initCause(cause);
    return pe;
  }

  public static ParseException newParseException(String message) {
    return new ParseException(message, 0);
View Full Code Here

      // fromValid(), we implement this method in terms of that one rather
      // than the reverse.

      ParseException parseException =
          new ParseException("Invalid host specifier: " + specifier, 0);
      parseException.initCause(e);
      throw parseException;
    }
  }

  /**
 
View Full Code Here

        try {
            return Integer.parseInt(reader.nextToken());
        } catch (NumberFormatException nfe) {
            ParseException pe = new ParseException(
                    "Error parsing integer value for " + directiveName + " directive", index);
            pe.initCause(nfe);
            throw pe;
        }
    }

    private void readDirective(CacheControl cacheControl,
View Full Code Here

                throw new ParseException("The quality source (qs) value, " + v + ", must be non-negative number", 0);
            }
            return qs;
        } catch (NumberFormatException ex) {
            ParseException pe = new ParseException("The quality source (qs) value, " + v + ", is not a valid value", 0);
            pe.initCause(ex);
            throw pe;
        }
    }

    @Override
View Full Code Here

        try {
            return Integer.valueOf(text, this.radix);
        }
        catch (NumberFormatException nfe) {
            ParseException pe = new ParseException("illegal format", 0);
            pe.initCause(nfe);
            throw pe;
        }
    }

    @Override
View Full Code Here

  @Override
  public void displayRecognitionError(String[] tokenNames, RecognitionException re) { 
      String message = " unexpected character '" + (char)re.c
                     + "' at position (" + re.charPositionInLine + ").";
      ParseException parseException = new ParseException(message, re.charPositionInLine);
      parseException.initCause(re);
      throw new RuntimeException(parseException);
  }


View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.