Examples of ParsingException


Examples of org.fest.swing.exception.ParsingException

  }

  private @Nonnull InputStream fileAsStream(String file) {
    InputStream stream = currentThread().getContextClassLoader().getResourceAsStream(file);
    if (stream == null) {
      throw new ParsingException(String.format("Unable to open file %s", file));
    }
    return stream;
  }
View Full Code Here

Examples of org.fest.swing.exception.ParsingException

  public @Nonnull KeyStrokeMappingProvider parse(@Nonnull File file) {
    assertThat(file).isFile();
    try {
      return parse(fileAsStream(file));
    } catch (IOException e) {
      throw new ParsingException(concat("An I/O error ocurred while parsing file ", file), e);
    }
  }
View Full Code Here

Examples of org.fest.swing.exception.ParsingException

  private @Nonnull InputStream fileAsStream(@Nonnull File file) {
    try {
      return new FileInputStream(file);
    } catch (FileNotFoundException e) {
      String msg = String.format("The file %s was not found", file.getPath());
      throw new ParsingException(msg, e);
    }
  }
View Full Code Here

Examples of org.fest.swing.exception.ParsingException

  @VisibleForTesting
  @Nonnull KeyStrokeMapping mappingFrom(@Nonnull String line) {
    String[] parts = line.trim().split(",");
    if (parts.length != 3) {
      String msg = String.format("Line '%s' does not conform with pattern '{char}, {keycode}, {modifiers}'", line);
      throw new ParsingException(msg);
    }
    char character = characterFrom(parts[0].trim());
    int keyCode = keyCodeFrom(parts[1].trim());
    int modifiers = modifiersFrom(parts[2].trim());
    return mapping(character, keyCode, modifiers);
View Full Code Here

Examples of org.fest.swing.exception.ParsingException

      return SPECIAL_MAPPINGS.get(s);
    }
    if (s.length() == 1) {
      return s.charAt(0);
    }
    throw new ParsingException(String.format("The text '%s' should have a single character", s));
  }
View Full Code Here

Examples of org.fest.swing.exception.ParsingException

  private static int keyCodeFrom(@Nonnull String s) {
    try {
      Integer keyCode = field("VK_" + s).ofType(int.class).in(KeyEvent.class).get();
      return checkNotNull(keyCode);
    } catch (ReflectionError e) {
      throw new ParsingException(concat("Unable to retrieve key code from text ", quote(s)), e.getCause());
    }
  }
View Full Code Here

Examples of org.fest.swing.exception.ParsingException

    }
    try {
      Integer modifiers = field(s).ofType(int.class).in(InputEvent.class).get();
      return checkNotNull(modifiers);
    } catch (ReflectionError e) {
      throw new ParsingException(concat("Unable to retrieve modifiers from text ", quote(s)), e.getCause());
    }
  }
View Full Code Here

Examples of org.infinispan.schematic.document.ParsingException

     */
    public Document read( URL url ) throws ParsingException {
        try {
            return read(url.openStream(), DEFAULT_INTROSPECT);
        } catch (IOException e) {
            throw new ParsingException(e.getMessage(), e, 0, 0);
        }
    }
View Full Code Here

Examples of org.jboss.dna.common.text.ParsingException

                if (tokens.matchesAnyOf("UNION", "INTERSECT", "EXCEPT")) {
                    command = parseSetQuery(tokens, command, typeSystem);
                } else {
                    Position pos = tokens.previousPosition();
                    String msg = GraphI18n.unexpectedToken.text(tokens.consume(), pos.getLine(), pos.getColumn());
                    throw new ParsingException(pos, msg);
                }
            }
        } else {
            // We expected SELECT ...
            Position pos = tokens.nextPosition();
            String msg = GraphI18n.unexpectedToken.text(tokens.consume(), pos.getLine(), pos.getColumn());
            throw new ParsingException(pos, msg);
        }
        return command;
    }
View Full Code Here

Examples of org.jboss.dna.common.text.ParsingException

                if (source instanceof Selector) {
                    selectorName = ((Selector)source).getName();
                } else {
                    Position pos = expression.getPosition();
                    String msg = GraphI18n.mustBeScopedAtLineAndColumn.text(expression, pos.getLine(), pos.getColumn());
                    throw new ParsingException(pos, msg);
                }
            }
            columns.add(new Column(selectorName, propertyName, expression.getColumnName()));
        }
        // Now create the query ...
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.