Package org.xml.sax

Examples of org.xml.sax.SAXParseException


            public GEObjectHandler(CullPropertyHandler parent, String namethrows SAXException {
                super(parent, name);
                try {
                    cd = Util.getDescriptorForCullType(name);
                } catch(IllegalArgumentException ilae) {
                    throw new SAXParseException("No descriptor for cull type " + name + " found", locator, ilae);
                }
                obj = cd.newInstance();
            }
View Full Code Here


            }
           
            public CullHandler getHandler(String name, org.xml.sax.Attributes attributes) throws SAXException {
                PropertyDescriptor pd = cd.getProperty(name);
                if (pd == null) {
                    throw new SAXParseException("cull type " + cd.getCullName() + " has no property " + name, locator);
                } if (pd instanceof SimplePropertyDescriptor) {
                    if (pd.getPropertyType().isPrimitive() || pd.getPropertyType().equals(String.class)) {
                        return new SimplePropertyHandler(this, (SimplePropertyDescriptor)pd);
                    } else {
                        return new ObjectPropertyHandler(this, (SimplePropertyDescriptor)pd);
                    }
                } else if (pd instanceof ListPropertyDescriptor) {
                    return new ListPropertyHandler(this, (ListPropertyDescriptor)pd);
                } else if (pd instanceof MapPropertyDescriptor) {
                    return new MapPropertyHandler(this, (MapPropertyDescriptor)pd, attributes);
                } else if (pd instanceof MapListPropertyDescriptor) {
                    return new MapListPropertyHandler(this, (MapListPropertyDescriptor)pd, attributes);
                } else {
                    throw new SAXParseException("Unknown property type " + pd.getClass(), locator);
                }
            }
View Full Code Here

                this.key = attributes.getValue("key");
            }
           
            public CullHandler getHandler(String name, org.xml.sax.Attributes attributesthrows SAXException {
                if (!pd.getCullType().equals(name)) {
                    throw new SAXParseException("This handler can only handle object of type " + pd.getCullType(), locator);
                }
                return super.getHandler(name, attributes);
            }
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

    Throwable cause = jenaExc.getCause();
    if ( ! (cause instanceof SAXParseException ) ) {
      return null;
    }
   
    SAXParseException spe = (SAXParseException) cause;
    String errorMessage = spe.getMessage() +
      "\n  Line number: " + spe.getLineNumber()+" Column number: " +spe.getColumnNumber()
//      +(spe.getPublicId() != null ? "\n Public ID: " + spe.getPublicId() : "" )
//      +(spe.getSystemId() != null ? "\n System ID: " + spe.getSystemId() : "" )
    ;

    return errorMessage;
View Full Code Here

        state = operand;
      }
    }
    catch (final IOException e) {
      this.errorHandler.fatalError(new SAXParseException(e.toString(), null, null, this.lineNumber, this.columnNumber, e));
    }
    finally {
      this.errorHandler = this;
      this.documentHandler = this.extDocumentHandler = this;
      this.tags.removeAllElements();
View Full Code Here

  public int getColumnNumber () {
    return this.columnNumber;
  }

  private void fatalError(final String msg, final int lineNumber, final int columnNumber) throws SAXException {
    this.errorHandler.fatalError(new SAXParseException(msg, null, null, lineNumber, columnNumber));
  }
View Full Code Here

      }

      String msg = sm.getString("xml.parse") + ": " + systemId +
          " : " + lineNumber + "\n  msg : " + message;

      throw new SAXParseException(msg, publicId, systemId,
          lineNumber, columnNumber);
  }

  XMLTree xmlElement = new XMLTree();
        Element element = doc.getDocumentElement();
View Full Code Here

        String currentPrefix = getPrefix(current.getQName());
       
        // jsp:text must not have any subelements
        if (JSP_URI.equals(uri) && TEXT_ACTION.equals(current.getLocalName())
                && "jsp".equals(currentPrefix)) {
            throw new SAXParseException(
                Localizer.getMessage("jsp.error.text.has_subelement"),
                locator);
        }

        startMark = new Mark(ctxt, path, locator.getLineNumber(),
View Full Code Here

                    boolean singleQ = false;
                    boolean doubleQ = false;
                    lastCh = 0;
                    for (;; i++) {
                        if (i >= charBuffer.length()) {
                            throw new SAXParseException(
                                Localizer.getMessage(
                                    "jsp.error.unterminated",
                                    (char) elType + "{"),
                                locator);
View Full Code Here

TOP

Related Classes of org.xml.sax.SAXParseException

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.