Package com.google.gxp.compiler.alerts.common

Examples of com.google.gxp.compiler.alerts.common.SaxAlert


  public static Schema getSchema(FileRef input, AlertSink alertSink) {
    SourcePosition pos = new SourcePosition(input);
    try {
      return Preconditions.checkNotNull(INSTANCE.parse(input));
    } catch (SAXException saxException) {
      alertSink.add(new SaxAlert(pos, Severity.ERROR, saxException));
      return null;
    } catch (IOException iox) {
      alertSink.add(new IOError(pos, iox));
      return null;
    }
View Full Code Here


  /**
   * Assert a {@code SaxError} based on the given {@code SourcePosition}
   * and message.
   */
  protected final void assertParseAlert(SourcePosition pos, String message) {
    assertAlert(new SaxAlert(pos, Severity.ERROR,
                             new SAXParseException(message, null)));
  }
View Full Code Here

        xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);

        xmlReader.parse(inputSource);
      } catch (SAXException saxException) {
        if (!saxEventAdapter.getExceptionMessages().contains(saxException.getMessage())) {
          eventHandler.add(new SaxAlert(new SourcePosition(input),
                                        Severity.ERROR, saxException));
        }
      }
    } finally {
      inputStream.close();
View Full Code Here

    /** Implements {@code ErrorHandler}. */
    public void warning(SAXParseException exception)
        throws SAXException {
      try {
        eventHandler.add(new SaxAlert(getSourcePosition(), Severity.WARNING,
                                      exception));
        exceptionMessages.add(exception.getMessage());
      } finally {
        recordPosition();
      }
View Full Code Here

    /** Implements {@code ErrorHandler}. */
    public void error(SAXParseException exception)
        throws SAXException {
      try {
        eventHandler.add(new SaxAlert(getSourcePosition(), Severity.ERROR,
                                      exception));
        exceptionMessages.add(exception.getMessage());
      } finally {
        recordPosition();
      }
View Full Code Here

    /** Implements {@code ErrorHandler}. */
    public void fatalError(SAXParseException exception)
        throws SAXException {
      try {
        eventHandler.add(new SaxAlert(getSourcePosition(), Severity.ERROR,
                                      exception));
        exceptionMessages.add(exception.getMessage());
      } finally {
        recordPosition();
      }
View Full Code Here

  /**
   * Assert a {@code SaxError} based on the given {@code SourcePosition}
   * and message.
   */
  protected final void assertParseAlert(SourcePosition pos, String message) {
    assertAlert(new SaxAlert(pos, Severity.ERROR,
                             new SAXParseException(message, null)));
  }
View Full Code Here

  public static Schema getSchema(FileRef input, AlertSink alertSink) {
    SourcePosition pos = new SourcePosition(input);
    try {
      return Preconditions.checkNotNull(INSTANCE.parse(input));
    } catch (SAXException saxException) {
      alertSink.add(new SaxAlert(pos, Severity.ERROR, saxException));
      return null;
    } catch (IOException iox) {
      alertSink.add(new IOError(pos, iox));
      return null;
    }
View Full Code Here

TOP

Related Classes of com.google.gxp.compiler.alerts.common.SaxAlert

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.