Examples of LTSVParseException


Examples of am.ik.ltsv4j.exception.LTSVParseException

   * @param line
   * @return
   */
  public Map<String, String> parseLine(String line) {
    if (line == null) {
      throw new LTSVParseException("line must not be null.");
    }

    StringTokenizer tokenizer = new StringTokenizer(chomp(line), LTSV.TAB);
    Map<String, String> result = mapFactory.createMap();
    while (tokenizer.hasMoreTokens()) {
      String labeledField = tokenizer.nextToken();
      String[] values = SEPARATOR_PATTERN.split(labeledField, 2);
      if (values.length != 2) {
        throw new LTSVParseException("label and field (" + labeledField
            + ") are not separated by " + LTSV.SEPARATOR);
      }
      String label = values[0];
      String field = values[1];

View Full Code Here

Examples of am.ik.ltsv4j.exception.LTSVParseException

  /**
   * @param field
   */
  private void validateField(String field) {
    if (!FIELD_PATTERN.matcher(field).matches()) {
      throw new LTSVParseException("field(" + field + ") is not valid.");
    }
  }
View Full Code Here

Examples of am.ik.ltsv4j.exception.LTSVParseException

  /**
   * @param label
   */
  private void validateLabel(String label) {
    if (!LABEL_PATTERN.matcher(label).matches()) {
      throw new LTSVParseException("field(" + label + ") is not valid.");
    }
  }
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.