Package org.openbel.framework.core.compiler

Examples of org.openbel.framework.core.compiler.ValidationError


        } catch (SAXParseException e) {
            final String name = e.getSystemId();
            final String msg = e.getMessage();
            final int line = e.getLineNumber();
            final int column = e.getColumnNumber();
            throw new ValidationError(name, msg, e, line, column);
        } catch (SAXException e) {
            // TODO This isn't the intended design here
            throw new RuntimeException(e);
        } catch (IOException e) {
            // TODO This isn't the intended design here
View Full Code Here


        for (final SAXParseException saxError : saxErrors) {
            final String name = saxError.getSystemId();
            final String msg = saxError.getMessage();
            final int line = saxError.getLineNumber();
            final int column = saxError.getColumnNumber();
            ret.add(new ValidationError(name, msg, saxError, line, column));
        }
        return ret;
    }
View Full Code Here

        } catch (SAXParseException e) {
            final String name = e.getSystemId();
            final String msg = e.getMessage();
            final int line = e.getLineNumber();
            final int column = e.getColumnNumber();
            throw new ValidationError(name, msg, e, line, column);
        } catch (SAXException e) {
            // TODO This isn't the intended design here
            throw new RuntimeException(e);
        } catch (IOException e) {
            // TODO This isn't the intended design here
View Full Code Here

        } catch (SAXParseException e) {
            final String name = e.getSystemId();
            final String msg = e.getMessage();
            final int line = e.getLineNumber();
            final int column = e.getColumnNumber();
            return asList(new ValidationError(name, msg, e, line, column));
        } catch (SAXException e) {
            final String name = f.toString();
            final String msg = e.getMessage();
            return asList(new ValidationError(name, msg, e, -1, -1));
        } catch (IOException e) {
            final String name = f.toString();
            final String msg = e.getMessage();
            return asList(new ValidationError(name, msg, e, -1, -1));
        }

        List<ValidationError> ret = sizedArrayList(saxErrors.size());
        for (final SAXParseException saxError : saxErrors) {
            final String name = saxError.getSystemId();
            final String msg = saxError.getMessage();
            final int line = saxError.getLineNumber();
            final int column = saxError.getColumnNumber();
            ret.add(new ValidationError(name, msg, saxError, line, column));
        }
        return ret;
    }
View Full Code Here

                    final int numWarnings = warnings.size();
                    reportable.output(format("%d BEL parser warning%s:",
                            numWarnings, (numWarnings == 1 ? "" : "s")));
                    int i = 0;
                    for (BELParseWarningException warning : warnings) {
                        final ValidationError err = new ValidationError(
                                inputFilePath,
                                warning.getMessage(),
                                warning.getLine(),
                                warning.getCharacter());
                        reportable.output(format("%5d. %s", ++i,
                                err.getUserFacingMessage()));
                    }
                }
                if (hasItems(errors)) {
                    final int numErrors = errors.size();
                    reportable.output(format("%d BEL parser error%s:",
                            numErrors, (numErrors == 1 ? "" : "s")));
                    int i = 0;
                    for (BELParseErrorException error : errors) {
                        final ValidationError err = new ValidationError(
                                inputFilePath,
                                error.getMessage(),
                                error.getLine(),
                                error.getCharacter());
                        reportable.output(format("%5d. %s", ++i,
                                err.getUserFacingMessage()));
                    }
                }
            }

            final Document bel =
View Full Code Here

                // if validation errors exist then report and fail document
                if (hasItems(results.getSyntaxErrors())) {
                    for (BELParseErrorException syntaxError : results
                            .getSyntaxErrors()) {
                        validationErrors.add(new ValidationError(file
                                .getAbsolutePath(), syntaxError
                                .getMessage(),
                                syntaxError.getLine(), syntaxError
                                        .getCharacter()));
                    }
View Full Code Here

        Stage1Output output = new Stage1Output();

        BELParseResults rslts = belValidator.validateBELScript(f);
        List<BELParseErrorException> sntxErrs = rslts.getSyntaxErrors();
        if (hasItems(sntxErrs)) {
            ValidationError ve;
            for (BELParseErrorException err : sntxErrs) {
                final String name = f.getAbsolutePath();
                final String msg = err.getMessage();
                final int line = err.getLine();
                final int col = err.getCharacter();
                ve = new ValidationError(name, msg, line, col);
                output.addValidationError(ve);
            }
            return output;
        }
View Full Code Here

TOP

Related Classes of org.openbel.framework.core.compiler.ValidationError

Copyright © 2018 www.massapicom. 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.