Package org.xml.sax

Examples of org.xml.sax.SAXParseException


    public void unparsedEntityDecl(String name, String publicId,
                                   String systemId, String notation)
  throws SAXException
    {
        if (name.indexOf(':') != -1) {
            throw new SAXParseException((getMessage("XDB-012")), locator);
        }
        super.unparsedEntityDecl(name, publicId, systemId, notation);
    }
View Full Code Here


            return true;
        } catch (Exception e) {
            this.exception = e;
            if (e instanceof SAXParseException) {
                SAXParseException saxException = (SAXParseException) e;
                this.lineNumber = saxException.getLineNumber();
                this.columnNumber = saxException.getColumnNumber();
            }
            return false;
        }
    }
View Full Code Here

                    if(getUriType(location) == NOROOT_REL_URI) {
                        location = "/WEB-INF/" + location;
                    }
                }
                catch(TemplateModelException e) {
                    throw new SAXParseException(e.getMessage(), locator, e);
                }
                buf = null;
            }
            else if ("taglib".equals(qName)) {
                final String zname;
View Full Code Here

                    tags.put(tagName, impl);
                    tagName = null;
                    tagClassName = null;
                }
                catch (IntrospectionException e) {
                    throw new SAXParseException(
                        "Can't introspect tag class " + tagClassName,
                        locator,
                        e);
                }
                catch (ClassNotFoundException e) {
                    throw new SAXParseException(
                        "Can't find tag class " + tagClassName,
                        locator,
                        e);
                }
            }
            else if ("listener-class".equals(qName)) {
                String listenerClass = buf.toString().trim();
                buf = null;
                try {
                    listeners.add(ClassUtil.forName(listenerClass).newInstance());
                }
                catch(Exception e) {
                    throw new SAXParseException(
                        "Can't instantiate listener class " + listenerClass,
                        locator,
                        e);
                }
            }
View Full Code Here

                }
                try {
                    Thread.currentThread().setContextClassLoader(newLoader);
                    reader.read(new StringReader(new String(Util.getResourceContentsAsCharArray((IFile) res))));
                    for ( Iterator iter = reader.getErrors().iterator(); iter.hasNext(); ) {
                        SAXParseException e = (SAXParseException) iter.next();                                           
                        createMarker(res, e.getMessage(), e.getLineNumber(), e.getColumnNumber());
                    }
                    for (Iterator iter = reader.getWarnings().iterator(); iter.hasNext(); ) {
                        SAXParseException e = (SAXParseException) iter.next();
                        createWarning(res, e.getMessage(), e.getLineNumber(), e.getColumnNumber());
                    }
                } catch (Exception t) {
                    throw t;
                } finally {
                    Thread.currentThread().setContextClassLoader(oldLoader);
                }
            } catch (SAXParseException e) {
                Exception ex = e.getException();
                if (ex instanceof FactoryException) {
                    Throwable t = ex.getCause();
                    if (t instanceof CompilationException) {
                        CompilationException exc = (CompilationException) t;
                        createMarker(res, exc.getErrorMessage(), reader.getLocator().getLineNumber(), reader.getLocator().getColumnNumber());
                    } else if (t instanceof NoViableAltException) {
                        NoViableAltException exc = (NoViableAltException) t;
                        createMarker(res, exc.getMessage(), reader.getLocator().getLineNumber(), reader.getLocator().getColumnNumber());
                    } else if (t == null) {
                        createMarker(res, ex.getMessage(), reader.getLocator().getLineNumber(), reader.getLocator().getColumnNumber());
                    } else {
                        createMarker(res, t.getMessage(), reader.getLocator().getLineNumber(), reader.getLocator().getColumnNumber());
                    }
                } else if (ex instanceof NoConsequenceException) {
                    createMarker(res, "No consequence", reader.getLocator().getLineNumber(), reader.getLocator().getColumnNumber());
                } else if (ex == null) {
                  if (reader.getLocator() != null) {
                    createMarker(res, e.getMessage(), reader.getLocator().getLineNumber(), reader.getLocator().getColumnNumber());
                  } else {
                    createMarker(res, e.getMessage(), -1, -1);
                  }
                } else {
                  if (reader.getLocator() != null) {
                    createMarker(res, e.getMessage(), reader.getLocator().getLineNumber(), reader.getLocator().getColumnNumber());
                  } else {
                    createMarker(res, e.getMessage(), -1, -1);
                  }
                }
            } catch (Exception e) {
                createMarker(res, e.getMessage(), reader.getLocator().getLineNumber(), reader.getLocator().getColumnNumber());
            }
            return false;
        }
        return true;
    }
View Full Code Here

        String identifier = attrs.getValue( "identifier" );

        if ( identifier == null || identifier.trim( ).equals( "" ) )
        {
            throw new SAXParseException(
                    "<parameter> requires an 'identifier' attribute",
                    ruleSetReader.getLocator( ) );
        }

        identifier = identifier.trim( );

        try
        {
            return rule.addParameterDeclaration( identifier, null );
        }
        catch ( InvalidRuleException e )
        {
            throw new SAXParseException( "'" + identifier + "' is already defined", ruleSetReader.getLocator() );
        }
    }
View Full Code Here

        Declaration declaration = (Declaration) ruleSetReader.getCurrent( );
        Rule rule = (Rule) ruleSetReader.getParent( Rule.class );

        if ( rule == null || declaration == null )
        {
            throw new SAXParseException( "unable to construct <parameter>",
                    ruleSetReader.getLocator( ) );
        }

        if ( declaration.getObjectType( ) == null )
        {
            throw new SAXParseException( "<parameter> requires an object-type",
                    ruleSetReader.getLocator( ) );
        }

        return null;
    }
View Full Code Here

            rule.setDuration( duration );
        }
        catch ( FactoryException e )
        {
            throw new SAXParseException( "error constructing duration",
                    this.ruleSetReader.getLocator( ), e );
        }
        return duration;
    }
View Full Code Here

                rule.addCondition( conditions[i] );
            }
        }
        catch ( FactoryException e )
        {   
            throw new SAXParseException( "error constructing condition",
                                         this.ruleSetReader.getLocator( ),
                                         e );
        }
        return conditions[conditions.length-1];
    }
View Full Code Here

            declaration.setObjectType( objectType );
        }
        catch ( FactoryException e )
        {
            throw new SAXParseException( "error constructing object type",
                                         this.ruleSetReader.getLocator( ),
                                         e );
        }
        return null;
    }
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.