Package org.apache.commons.jelly
Class Jelly
- java.lang.Object
-
- org.apache.commons.jelly.Jelly
-
public class Jelly extends Object
Command line usage is as follows:Jelly
is a helper class which is capable of running a Jelly script. This class can be used from the command line or can be used as the basis of an Ant task.jelly [scriptFile] [-script scriptFile -o outputFile -Dsysprop=syspropval]
- Version:
- $Revision: 155420 $
- Author:
- James Strachan
-
-
Constructor Summary
Constructors Constructor Description Jelly()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Script
compileScript()
Compiles the scriptstatic String
getJellyBuildDate()
JellyContext
getJellyContext()
The context to usestatic String
getJellyVersion()
URL
getRootContext()
Gets the root contextURL
getUrl()
protected void
loadJellyProperties()
Attempts to load jelly.properties from the current directory, the users home directory or from the classpathprotected void
loadProperties(InputStream is)
Loads the properties from the given input streamstatic void
main(String[] args)
Usage: jelly [scriptFile] [-script scriptFile -o outputFile -Dsysprop=syspropval]protected URL
resolveURL(String name)
void
setDefaultNamespaceURI(String namespace)
Set the jelly namespace to use for unprefixed elements.void
setRootContext(URL rootContext)
Sets the root contextvoid
setScript(String script)
Sets the script URL to use as an absolute URL or a relative filenamevoid
setUrl(URL url)
Sets the script URL to usevoid
setValidateXML(boolean validate)
When set to true, the XML parser will attempt to validate the Jelly XML before converting it into a Script.
-
-
-
Method Detail
-
main
public static void main(String[] args) throws Exception
Usage: jelly [scriptFile] [-script scriptFile -o outputFile -Dsysprop=syspropval]- Throws:
Exception
-
getJellyVersion
public static String getJellyVersion()
-
getJellyBuildDate
public static String getJellyBuildDate()
-
compileScript
public Script compileScript() throws JellyException
Compiles the script- Throws:
JellyException
-
setScript
public void setScript(String script) throws MalformedURLException
Sets the script URL to use as an absolute URL or a relative filename- Throws:
MalformedURLException
-
getUrl
public URL getUrl()
-
setUrl
public void setUrl(URL url)
Sets the script URL to use
-
getRootContext
public URL getRootContext() throws MalformedURLException
Gets the root context- Throws:
MalformedURLException
-
setRootContext
public void setRootContext(URL rootContext)
Sets the root context
-
getJellyContext
public JellyContext getJellyContext() throws MalformedURLException
The context to use- Throws:
MalformedURLException
-
setDefaultNamespaceURI
public void setDefaultNamespaceURI(String namespace)
Set the jelly namespace to use for unprefixed elements. Will be overridden by an explicit namespace in the XML document.- Parameters:
namespace
- jelly namespace to use (e.g. 'jelly:core')
-
setValidateXML
public void setValidateXML(boolean validate)
When set to true, the XML parser will attempt to validate the Jelly XML before converting it into a Script.- Parameters:
validate
- whether or not to validate
-
resolveURL
protected URL resolveURL(String name) throws MalformedURLException
- Returns:
- the URL for the relative file name or absolute URL
- Throws:
MalformedURLException
-
loadJellyProperties
protected void loadJellyProperties()
Attempts to load jelly.properties from the current directory, the users home directory or from the classpath
-
loadProperties
protected void loadProperties(InputStream is) throws IOException
Loads the properties from the given input stream- Throws:
IOException
-
-