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 StringThe context to usestatic StringGets the root contextgetUrl()protected voidAttempts to load jelly.properties from the current directory, the users home directory or from the classpathprotected voidLoads the properties from the given input streamstatic voidUsage: jelly [scriptFile] [-script scriptFile -o outputFile -Dsysprop=syspropval]protected URLresolveURL(String name) voidsetDefaultNamespaceURI(String namespace) Set the jelly namespace to use for unprefixed elements.voidsetRootContext(URL rootContext) Sets the root contextvoidSets the script URL to use as an absolute URL or a relative filenamevoidSets the script URL to usevoidsetValidateXML(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
-