## org.apache.commons.jelly
Class Jelly

    java.lang.Object
      org.apache.commons.jelly.Jelly

    public class Jelly

extends java.lang.Object

`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.

Command line usage is as follows:

     jelly [scriptFile] [-script scriptFile -o outputFile -Dsysprop=syspropval]

Version:
  $Revision: 155420 $
Author:
  James Strachan

Constructor Summary
`Jelly()`

Method Summary
`Script` `compileScript()` Compiles the script
`static java.lang.String` `getJellyBuildDate()`
`JellyContext` `getJellyContext()` The context to use
`static java.lang.String` `getJellyVersion()`
`java.net.URL` `getRootContext()` Gets the root context
`java.net.URL` `getUrl()`
`protected void` `loadJellyProperties()` Attempts to load jelly.properties from the current directory, the users home directory or from the classpath
`protected void` `loadProperties(java.io.InputStream is)` Loads the properties from the given input stream
`static void` `main(java.lang.String[] args)` Usage: jelly [scriptFile] [-script scriptFile -o outputFile -Dsysprop=syspropval]
`protected java.net.URL` `resolveURL(java.lang.String name)`
`void` `setDefaultNamespaceURI(java.lang.String namespace)` Set the jelly namespace to use for unprefixed elements.
`void` `setRootContext(java.net.URL rootContext)` Sets the root context
`void` `setScript(java.lang.String script)` Sets the script URL to use as an absolute URL or a relative filename
`void` `setUrl(java.net.URL url)` Sets the script URL to use
`void` `setValidateXML(boolean validate)` When set to true, the XML parser will attempt to validate the Jelly XML before converting it into a Script.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Jelly

    public Jelly()

Method Detail

### main

    public static void main(java.lang.String[] args)
                     throws java.lang.Exception

  Usage: jelly [scriptFile] [-script scriptFile -o outputFile -Dsysprop=syspropval]

  Throws:
    `java.lang.Exception`

### getJellyVersion

    public static java.lang.String getJellyVersion()

### getJellyBuildDate

    public static java.lang.String getJellyBuildDate()

### compileScript

    public Script compileScript()
                         throws JellyException

  Compiles the script

  Throws:
    `JellyException`

### setScript

    public void setScript(java.lang.String script)
                   throws java.net.MalformedURLException

  Sets the script URL to use as an absolute URL or a relative filename

  Throws:
    `java.net.MalformedURLException`

### getUrl

    public java.net.URL getUrl()

### setUrl

    public void setUrl(java.net.URL url)

  Sets the script URL to use

### getRootContext

    public java.net.URL getRootContext()
                                throws java.net.MalformedURLException

  Gets the root context

  Throws:
    `java.net.MalformedURLException`

### setRootContext

    public void setRootContext(java.net.URL rootContext)

  Sets the root context

### getJellyContext

    public JellyContext getJellyContext()
                                 throws java.net.MalformedURLException

  The context to use

  Throws:
    `java.net.MalformedURLException`

### setDefaultNamespaceURI

    public void setDefaultNamespaceURI(java.lang.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 java.net.URL resolveURL(java.lang.String name)
                               throws java.net.MalformedURLException

  Returns:
    the URL for the relative file name or absolute URL
  Throws:
    `java.net.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(java.io.InputStream is)
                           throws java.io.IOException

  Loads the properties from the given input stream

  Throws:
    `java.io.IOException`

Copyright © 2002-2005 Apache Software Foundation. All Rights Reserved.