Package org.drools.xml

Examples of org.drools.xml.XmlPackageReader


     * @throws DroolsParserException
     * @throws IOException
     */
    public void addPackageFromXml(final Reader reader) throws DroolsParserException,
                                                      IOException {
        final XmlPackageReader xmlReader = new XmlPackageReader( this.configuration.getSemanticModules() );

        try {
            xmlReader.read( reader );
        } catch ( final SAXException e ) {
            throw new DroolsParserException( e.toString(),
                                             e.getCause() );
        }

        addPackage( xmlReader.getPackageDescr() );
    }
View Full Code Here


public class DumperTestHelper extends Assert {
   
    public static void XmlFile(String filename) throws Exception {
        PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
       
        XmlPackageReader xmlPackageReader = new XmlPackageReader( conf.getSemanticModules() );
        xmlPackageReader.read( new InputStreamReader( DumperTestHelper.class.getResourceAsStream( filename ) ) );
        final PackageDescr pkgOriginal = xmlPackageReader.getPackageDescr();

        final XmlDumper dumper = new XmlDumper();
        final String result = dumper.dump( pkgOriginal );
       
        String buffer = readFile( filename );
View Full Code Here

     * @throws DroolsParserException
     * @throws IOException
     */
    public void addPackageFromXml(final Reader reader) throws DroolsParserException,
                                                      IOException {
        final XmlPackageReader xmlReader = new XmlPackageReader();

        try {
            xmlReader.read( reader );
        } catch ( final SAXException e ) {
            throw new DroolsParserException( e.toString(),
                                             e.getCause() );
        }

        addPackage( xmlReader.getPackageDescr() );
    }
View Full Code Here

     * @throws DroolsParserException
     * @throws IOException
     */
    public void addPackageFromXml(final Reader reader) throws DroolsParserException,
                                                      IOException {
        final XmlPackageReader xmlReader = new XmlPackageReader();

        try {
            xmlReader.read( reader );
        } catch ( final SAXException e ) {
            throw new DroolsParserException( e.toString(),
                                             e.getCause() );
        }

        addPackage( xmlReader.getPackageDescr() );
    }
View Full Code Here

                                                   final Map properties) throws RuleExecutionSetCreateException {
        try {
            //         Prepare the DOM source
            final Source source = new DOMSource( ruleExecutionSetElement );

            final XmlPackageReader xmlPackageReader = new XmlPackageReader();
            // Prepare the result
            final SAXResult result = new SAXResult( xmlPackageReader );

            // Create a transformer
            final Transformer xformer = TransformerFactory.newInstance().newTransformer();

            // Traverse the DOM tree
            xformer.transform( source,
                               result );

            final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();

            //          pre build the package
            final PackageBuilder builder = new PackageBuilder();
            builder.addPackage( packageDescr );
            final Package pkg = builder.getPackage();
View Full Code Here

                                                   final Map properties) throws RuleExecutionSetCreateException {
        try {
            //         Prepare the DOM source
            final Source source = new DOMSource( ruleExecutionSetElement );

            final XmlPackageReader xmlPackageReader = new XmlPackageReader( new SemanticModules() );
            // Prepare the result
            final SAXResult result = new SAXResult( xmlPackageReader.getParser() );

            // Create a transformer
            final Transformer xformer = TransformerFactory.newInstance().newTransformer();

            // Traverse the DOM tree
            xformer.transform( source,
                               result );

            final PackageDescr packageDescr = xmlPackageReader.getPackageDescr();

            //          pre build the package
            final PackageBuilder builder = new PackageBuilder();
            builder.addPackage( packageDescr );
            final Package pkg = builder.getPackage();
View Full Code Here

     * @throws IOException
     */
    public void addPackageFromXml(final Reader reader) throws DroolsParserException,
                                                      IOException {
        this.resource = new ReaderResource( reader );
        final XmlPackageReader xmlReader = new XmlPackageReader( this.configuration.getSemanticModules() );

        try {
            xmlReader.read( reader );
        } catch ( final SAXException e ) {
            throw new DroolsParserException( e.toString(),
                                             e.getCause() );
        }

        addPackage( xmlReader.getPackageDescr() );
        this.resource = null;
    }
View Full Code Here

    public void addPackageFromXml(final Resource resource) throws DroolsParserException,
                                                          IOException {
        this.resource = resource;

        final XmlPackageReader xmlReader = new XmlPackageReader( this.configuration.getSemanticModules() );

        try {
            xmlReader.read( resource.getReader() );
        } catch ( final SAXException e ) {
            throw new DroolsParserException( e.toString(),
                                             e.getCause() );
        }

        addPackage( xmlReader.getPackageDescr() );
        this.resource = null;
    }
View Full Code Here

     * @throws IOException
     */
    public void addPackageFromXml(final Reader reader) throws DroolsParserException,
                                                      IOException {
        this.resource = new ReaderResource( reader );
        final XmlPackageReader xmlReader = new XmlPackageReader( this.configuration.getSemanticModules() );

        try {
            xmlReader.read( reader );
        } catch ( final SAXException e ) {
            throw new DroolsParserException( e.toString(),
                                             e.getCause() );
        }

        addPackage( xmlReader.getPackageDescr() );
        this.resource = null;
    }
View Full Code Here

    public void addPackageFromXml(final Resource resource) throws DroolsParserException,
                                                          IOException {
        this.resource = resource;

        final XmlPackageReader xmlReader = new XmlPackageReader( this.configuration.getSemanticModules() );

        try {
            xmlReader.read( resource.getReader() );
        } catch ( final SAXException e ) {
            throw new DroolsParserException( e.toString(),
                                             e.getCause() );
        }

        addPackage( xmlReader.getPackageDescr() );
        this.resource = null;
    }
View Full Code Here

TOP

Related Classes of org.drools.xml.XmlPackageReader

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.