/** * Compiles the tags body */ public Script compile() throws JellyException { if (tagBody != null) { tagBody = tagBody.compile(); } return this; }
/** * Compiles the tags body */ public Script compile() throws JellyException { if (tagBody != null) { tagBody = tagBody.compile(); } return this; }
/** * Compiles the tags body */ public Script compile() throws JellyException { if (tagBody != null) { tagBody = tagBody.compile(); } return this; }
public Script compile() throws JellyException { base = base.compile(); return this; }
/** * Compiles the tags body */ public Script compile() throws JellyException { if (tagBody != null) { tagBody = tagBody.compile(); } return this; }
public Script compile() throws JellyException { base = base.compile(); return this; }
/** * Compile the script */ private void compileScriptAndKeep() { XMLParser parser = new XMLParser(); parser.setContext(m_context); m_scriptCompiled = false; try { m_script = parser.parse(m_inputStream); m_script = m_script.compile(); m_scriptCompiled = true; } catch (IOException e) { m_scriptCompilationException = e; } catch (SAXException e) { m_scriptCompilationException = e; } catch (Exception e) { m_scriptCompilationException = e; } }
/** * Attempts to parse the script from the given InputSource using the * {@link #getResource} method then returns the compiled script. */ public Script compileScript(InputSource source) throws JellyException { XMLParser parser = getXMLParser(); parser.setContext(this); Script script = null; try { script = parser.parse(source); } catch (IOException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+source.getSystemId(), e); } catch (SAXException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+source.getSystemId(), e); } return script.compile(); }
/** * Attempts to parse the script from the given InputSource using the * {@link #getResource} method then returns the compiled script. */ public Script compileScript(InputSource source) throws JellyException { XMLParser parser = getXMLParser(); parser.setContext(this); Script script = null; try { script = parser.parse(source); } catch (IOException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+source.getSystemId(), e); } catch (SAXException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+source.getSystemId(), e); } return script.compile(); }
/** * Attempts to parse the script from the given InputSource using the * {@link #getResource} method then returns the compiled script. */ public Script compileScript(InputSource source) throws JellyException { XMLParser parser = getXMLParser(); parser.setContext(this); Script script = null; try { script = parser.parse(source); } catch (IOException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+source.getSystemId(), e); } catch (SAXException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+source.getSystemId(), e); } return script.compile(); }
/** * Attempts to parse the script from the given URL using the * {@link #getResource} method then returns the compiled script. */ public Script compileScript(URL url) throws JellyException { XMLParser parser = getXMLParser(); parser.setContext(this); Script script = null; try { script = parser.parse(url.toString()); } catch (IOException e) { throw new JellyException(JellyContext.BAD_PARSE, e); } catch (SAXException e) { throw new JellyException(JellyContext.BAD_PARSE, e); } return script.compile(); }
/** * Attempts to parse the script from the given URL using the * {@link #getResource} method then returns the compiled script. */ public Script compileScript(URL url) throws JellyException { XMLParser parser = getXMLParser(); parser.setContext(this); Script script; try { script = parser.parse(url.toString()); } catch (IOException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+url, e); } catch (SAXException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+url, e); } return script.compile(); }
/** * Attempts to parse the script from the given URL using the * {@link #getResource} method then returns the compiled script. */ public Script compileScript(URL url) throws JellyException { XMLParser parser = getXMLParser(); parser.setContext(this); Script script; try { script = parser.parse(url.toString()); } catch (IOException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+url, e); } catch (SAXException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+url, e); } return script.compile(); }
/** * Attempts to parse the script from the given URL using the * {@link #getResource} method then returns the compiled script. */ public Script compileScript(URL url) throws JellyException { XMLParser parser = getXMLParser(); parser.setContext(this); Script script; try { script = parser.parse(url.toString()); } catch (IOException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+url, e); } catch (SAXException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+url, e); } return script.compile(); }
/** * Attempts to parse the script from the given InputSource using the * {@link #getResource} method then returns the compiled script. */ public Script compileScript(InputSource source) throws JellyException { XMLParser parser = getXMLParser(); parser.setContext(this); Script script = null; try { script = parser.parse(source); } catch (IOException e) { throw new JellyException(JellyContext.BAD_PARSE, e); } catch (SAXException e) { throw new JellyException(JellyContext.BAD_PARSE, e); } return script.compile(); }
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); StringWriter buffer = new StringWriter(); script.run(context, XMLOutput.createXMLOutput(buffer)); String text = buffer.toString().trim(); if (log.isDebugEnabled()) { log.debug("Evaluated script as..."); log.debug(text); } assertEquals("Produces the correct output", "one two three", text); }