Package org.apache.commons.jelly
Class Jelly
java.lang.Object
org.apache.commons.jelly.Jelly
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 -
Method Summary
Modifier and TypeMethodDescriptionCompiles the scriptstatic String
The context to usestatic String
Gets the root contextgetUrl()
protected void
Attempts to load jelly.properties from the current directory, the users home directory or from the classpathprotected void
Loads the properties from the given input streamstatic void
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
Sets the script URL to use as an absolute URL or a relative filenamevoid
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.
-
Constructor Details
-
Jelly
public Jelly()
-
-
Method Details
-
main
Usage: jelly [scriptFile] [-script scriptFile -o outputFile -Dsysprop=syspropval]- Throws:
Exception
-
getJellyVersion
-
getJellyBuildDate
-
compileScript
Compiles the script- Throws:
JellyException
-
setScript
Sets the script URL to use as an absolute URL or a relative filename- Throws:
MalformedURLException
-
getUrl
-
setUrl
Sets the script URL to use -
getRootContext
Gets the root context- Throws:
MalformedURLException
-
setRootContext
Sets the root context -
getJellyContext
The context to use- Throws:
MalformedURLException
-
setDefaultNamespaceURI
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
- 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
Loads the properties from the given input stream- Throws:
IOException
-