Class Jelly

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

public class Jelly extends 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 Details

    • Jelly

      public Jelly()
  • Method Details

    • 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