Package org.xml.sax

Examples of org.xml.sax.SAXParseException


                                                  config );
            importer.addImport( importEntry );
        }
        catch ( FactoryException e )
        {
            throw new SAXParseException( "error constructing import",
                    ruleSetReader.getLocator( ), e );
        }
        return importEntry;
    }
View Full Code Here


                /* see if the uri is registered */
                try
                {
                    this.repo.lookupSemanticModule( uri );
                    /* uri is registered, but the element is not mapped correctly to a handler */
                    throw new SAXParseException( "unknown tag '" + localName + "' in namespace '" + uri + "'",
                                                 getLocator( ) );                   
                }
                catch ( NoSuchSemanticModuleException e )
                {
                    /* uri is not registered, so incorrect uri, missing drools.conf or classloader issues*/
                    throw new SAXParseException( "no semantic module for namespace '" + uri + "' (" + localName + ")",
                                                 getLocator() );
                }
               
               

View Full Code Here

                    validParent = true;
                }
            }
            if ( !validParent )
            {
                throw new SAXParseException( "<" + localName + "> has an invalid parent element",
                                             getLocator( ) );
            }
        }

        // check valid peers
        // null peer means localname is rule-set
        Object peer = this.peer;

        Object allowedPeer;
        Iterator it = validPeers.iterator( );
        while ( !validPeer && it.hasNext( ) )
        {
            allowedPeer = it.next( );
            if ( peer == null && allowedPeer == null )
            {
                validPeer = true;
            }
            else if ( allowedPeer != null && ((Class) allowedPeer).isInstance( peer ) )
            {
                validPeer = true;
            }
        }
        if ( !validPeer )
        {
            throw new SAXParseException( "<" + localName + "> is after an invalid element",
                                         getLocator( ) );
        }

        if ( !allowNesting )
        {
            it = this.parents.iterator( );
            while ( !invalidNesting && it.hasNext( ) )
            {
                if ( nodeClass.isInstance( it.next( ) ) )
                {
                    invalidNesting = true;
                }
            }
        }
        if ( invalidNesting )
        {
            throw new SAXParseException( "<" + localName + ">  may not be nested",
                                         getLocator( ) );
        }

    }
View Full Code Here

        {
            module = this.repo.lookupSemanticModule( uri );
        }
        catch ( NoSuchSemanticModuleException e )
        {
            throw new SAXParseException( "no semantic module for namespace '" + uri + "' (" + localName + ")",
                                         getLocator( ) );
        }
        return module;
    }
View Full Code Here

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

                rule.setSalience( salience );
            }
            catch ( NumberFormatException e )
            {
                throw new SAXParseException( "invalid number value for 'salience' attribute: " + salienceStr.trim( ),
                                             this.ruleSetReader.getLocator( ) );
            }
        }

        if ( !(noLoopStr == null || noLoopStr.trim( ).equals( "" )) )
        {
            try
            {
                boolean noLoop = new Boolean( noLoopStr.trim( ) ).booleanValue( );
                rule.setNoLoop( noLoop );
            }
            catch ( NumberFormatException e )
            {
                throw new SAXParseException( "invalid boolean value for 'no-loop' attribute: " + salienceStr.trim( ),
                                             this.ruleSetReader.getLocator( ) );
            }
        }
       
        if ( !(xorGroup == null || xorGroup.trim( ).equals( "" )) )
View Full Code Here

        {
            this.ruleSetReader.getRuleSet( ).addRule( (Rule) this.ruleSetReader.getParents( ).getLast( ) );
        }
        catch ( RuleConstructionException e )
        {
            throw new SAXParseException( "error adding rule",
                                         this.ruleSetReader.getLocator( ),
                                         e );
        }

        return null;
View Full Code Here

            this.ruleSetReader.getRuleSet( ).addApplicationData( applicationData );

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

            this.ruleSetReader.getRuleSet( ).addFunctions( ( ( SemanticComponent ) functions ).getSemanticType(),
                                                           functions );
        }
        catch ( FactoryException e )
        {
            throw new SAXParseException( "error constructing import",
                                         this.ruleSetReader.getLocator( ),
                                         e );
        }
        return functions;
    }
View Full Code Here

        String ruleSetName = attrs.getValue( "name" );
        String ruleSetDesc = attrs.getValue( "description" );

        if ( ruleSetName == null || ruleSetName.trim( ).equals( "" ) )
        {
            throw new SAXParseException(
                    "<rule-set> requires a 'name' attribute", ruleSetReader
                            .getLocator( ) );
        }

        RuleSet ruleSet = new RuleSet( ruleSetName.trim( ), this.ruleSetReader.getFactoryContext( ) );
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.