Package org.apache.commons.jelly

Examples of org.apache.commons.jelly.Script.compile()


        }
        if ( log.isDebugEnabled() )
            log.debug( "the system identifier to help resolve relative URLs : " + systemId );
        script = parser.parse( source );

        script = script.compile();

        return script;
    }

    /**
 
View Full Code Here


  jellyParser.setContext(context);
  jellyParser.configure ();
  reader.setContentHandler(new NamespaceAttributesFilter(jellyParser));
  reader.parse (inSrc);
  Script script = jellyParser.getScript ();
  script.compile ();
  script.run (context, XMLOutput.createXMLOutput(System.out));
    }
}
View Full Code Here

      ExtXMLParser jellyParser = new ExtXMLParser ();
      jellyParser.setContext(context);
      jellyParser.configure ();
      seb.emit (new NamespaceAttributesFilter(jellyParser));
      Script script = jellyParser.getScript ();
      script.compile ();
      SAXEventBufferImpl jres = new SAXEventBufferImpl ();
      jres.startDocument ();
      script.run (context, new XMLOutput(jres));
      jres.endDocument ();
      jres.pack ();
View Full Code Here

            // TODO - Compile the script and cache the compiled version
           
            scriptSource = this.resolver.resolveURI(this.source);
           
            Script script = this.jellyParser.parse(SourceUtil.getInputSource(scriptSource));
            script = script.compile();
           
            // the script does not output startDocument/endDocument events
            this.contentHandler.startDocument();
            script.run(this.jellyContext, xmlOutput);
            xmlOutput.flush();
View Full Code Here

            // TODO - Compile the script and cache the compiled version
           
            scriptSource = this.resolver.resolveURI(this.source);
           
            Script script = this.jellyParser.parse(SourceUtil.getInputSource(scriptSource));
            script = script.compile();
           
            // the script does not output startDocument/endDocument events
            this.contentHandler.startDocument();
            script.run(this.jellyContext, xmlOutput);
            xmlOutput.flush();
View Full Code Here

       
    protected Document runScript(String fileName) throws Exception {
        InputStream in = new FileInputStream(fileName);
        XMLParser parser = new XMLParser();
        Script script = parser.parse(in);
        script = script.compile();
        JellyContext context = parser.getContext();
       
        SAXContentHandler contentHandler = new SAXContentHandler();
        XMLOutput output = new XMLOutput( contentHandler );
       
View Full Code Here

     */
    public void testParser() throws Exception {
        InputStream in = new FileInputStream("src/test/org/apache/commons/jelly/sql/example2.jelly");
        XMLParser parser = new XMLParser();
        Script script = parser.parse(in);
        script = script.compile();
       
        log.debug("Found: " + script);
       
        assertTagsHaveParent( script, null );
    }
View Full Code Here

   
    public void testParse() throws Exception {
        InputStream in = new FileInputStream("src/test/org/apache/commons/jelly/xml/example.jelly");
        XMLParser parser = new XMLParser();
        Script script = parser.parse(in);
        script = script.compile();
        log.debug("Found: " + script);
        assertTrue("Parsed a Script", script instanceof Script);
        StringWriter buffer = new StringWriter();
        script.run(parser.getContext(), XMLOutput.createXMLOutput(buffer));
        String text = buffer.toString().trim();
View Full Code Here

    public Document parseUnitTest(String name) throws Exception {
        // parse script
        InputStream in = new FileInputStream(name);
        XMLParser parser = new XMLParser();
        Script script = parser.parse(in);
        script = script.compile();
        assertTrue("Parsed a Script", script instanceof Script);
        StringWriter buffer = new StringWriter();
        script.run(parser.getContext(), XMLOutput.createXMLOutput(buffer));

        String text = buffer.toString().trim();
View Full Code Here

    public void testArgs() throws Exception {
        InputStream in = new FileInputStream("src/test/org/apache/commons/jelly/test_args.jelly");
        XMLParser parser = new XMLParser();
        Script script = parser.parse(in);
        script = script.compile();
        log.debug("Found: " + script);
        assertTrue("Parsed a Script", script instanceof Script);
        String[] args = { "one", "two", "three" };
        JellyContext context = new JellyContext();
        context.setVariable("args", args);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.