org.apache.maven.jelly
Class MavenJellyContext

java.lang.Object
  extended byorg.apache.commons.jelly.JellyContext
      extended byorg.apache.maven.jelly.MavenJellyContext

public class MavenJellyContext
extends JellyContext

Specialized version of a JellyContext.

This class simply provides hooks for accessing the jelly run-time execution. Typical idiom simply includes adding poor-man's-aspects (PMAs) to a JellyContext an explicitly invoking the super-class implementation of a given method.

Version:
$Id: MavenJellyContext.java 517014 2007-03-11 21:15:50Z ltheussl $
Author:
bob mcwhirter, Jason van Zyl

Field Summary
 
Fields inherited from class org.apache.commons.jelly.JellyContext
classLoader, useContextClassLoader
 
Constructor Summary
MavenJellyContext()
          Construct.
MavenJellyContext(MavenJellyContext parent)
          Construct.
MavenJellyContext(java.net.URL rootContext)
          Construct.
 
Method Summary
protected  JellyContext createChildContext()
          Create a context with this as the parent
 void display()
          Display all maven variables
 org.apache.tools.ant.Project getAntProject()
          Get the ant project.
 java.lang.Boolean getBoolean(java.lang.String key)
          Convert a String property to a Boolean based on its contents.
 java.lang.Boolean getDebugOn()
          Get the debug flag.
 java.lang.Boolean getEmacsModeOn()
          Get the emacs mode flag.
 java.lang.String getMavenHome()
          Get MavenSession home.
 java.lang.String getMavenHomeLocal()
          Get local maven home.
 java.lang.Boolean getMavenJarOverride()
          Get the flag indicating the use of the JAR overriding facility.
 java.lang.String getMavenJarOverride(java.lang.String id)
          Get the maven jar override value for a particular dependency.
 java.lang.String getMavenRepoLocal()
          Get the location of the local maven repository.
 java.util.List getMavenRepoRemote()
          Get the mavenRepoRemote attribute.
 MavenSession getMavenSession()
          Get the mavenSession attribute.
 java.lang.Boolean getOnline()
          Get the online flag.
 java.lang.String getPluginsDir()
          Get plugins location.
 Project getProject()
          Get the maven project.
 java.lang.String getProxyHost()
          Get the proxy host.
 java.lang.String getProxyPassword()
          Get the proxy password.
 java.lang.String getProxyPort()
          Get the proxy port.
 java.lang.String getProxyUserName()
          Get the proxy user name.
 java.lang.Boolean getRemoteRepositoryEnabled()
          Set flag indicating if the remote repository is enabled for use.
 TagLibrary getTagLibrary(java.lang.String uri)
          Retrieve a registered TagLibrary by namespace URI.
 java.lang.String getUnpackedPluginsDir()
          Get unpacked plugins location.
 java.lang.String getUserPluginsDir()
          Get user plugins location.
 java.lang.Object getVariable(java.lang.String name)
          Retrieve a variable.
 WerkzProject getWerkzProject()
          retrieve the werkz project object
 XMLOutput getXMLOutput()
          Get the jelly output sink.
 void registerTagLibrary(java.lang.String namespaceURI, java.lang.String className)
          Register a new tag library.
 void registerTagLibrary(java.lang.String uri, TagLibrary taglib)
          Register a new tag library.
 void resolveRelativePaths(java.io.File basedir)
           
 void setAntProject(org.apache.tools.ant.Project antProject)
          Set the ant project.
 void setDebugOn(java.lang.Boolean debug)
          Set the debug flag.
 void setEmacsModeOn(java.lang.Boolean emacsModeOn)
          Set the emacs mode flag.
 void setMavenJarOverride(java.lang.Boolean mavenJarOverride)
          Set the flag indicating the use of the JAR overriding facility.
 void setMavenRepoLocal(java.lang.String mavenRepoLocal)
          Set the location of the local maven repository.
 void setMavenRepoRemotes(java.util.List mavenRepoRemote)
           
 void setMavenSession(MavenSession mavenSession)
          Set the mavenSession attribute.
 void setOnline(java.lang.Boolean online)
          Set the online flag.
 void setParent(JellyContext context)
           
 void setProject(Project project)
          Set the maven project.
 void setProxyHost(java.lang.String proxyHost)
          Set the proxy host.
 void setProxyPassword(java.lang.String proxyPassword)
          Set the proxy password.
 void setProxyPort(java.lang.String proxyPort)
          Set the proxy port.
 void setProxyUserName(java.lang.String proxyUserName)
          Set the proxy user name.
 void setRemoteRepositoryEnabled(java.lang.Boolean remoteRepositoryEnabled)
          Set flag indicating if the remote repository is enabled for use.
 void setWerkzProject(WerkzProject werkzProject)
          retrieve the werkz project object
 void setXMLOutput(XMLOutput xmlOutput)
          Set the jelly output sink.
 
Methods inherited from class org.apache.commons.jelly.JellyContext
clear, clearVariables, compileScript, compileScript, compileScript, createRelativeURL, createXMLParser, findVariable, getClassLoader, getCurrentURL, getJellyContextURL, getJellyContextURL, getParent, getResource, getResourceAsStream, getRootURL, getScope, getUseContextClassLoader, getVariable, getVariableNames, getVariables, getXMLParser, isCacheTags, isExport, isExportLibraries, isInherit, isTagLibraryRegistered, newJellyContext, newJellyContext, removeVariable, removeVariable, runScript, runScript, runScript, runScript, runScript, runScript, runScript, runScript, setCacheTags, setClassLoader, setCurrentURL, setExport, setExportLibraries, setInherit, setRootURL, setUseContextClassLoader, setVariable, setVariable, setVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MavenJellyContext

public MavenJellyContext()
Construct.


MavenJellyContext

public MavenJellyContext(java.net.URL rootContext)
Construct.

Parameters:
rootContext - The root context.

MavenJellyContext

public MavenJellyContext(MavenJellyContext parent)
Construct.

Parameters:
parent - Parent MavenJellyContext
Method Detail

createChildContext

protected JellyContext createChildContext()
Create a context with this as the parent

Returns:
a new context

registerTagLibrary

public void registerTagLibrary(java.lang.String uri,
                               TagLibrary taglib)
Register a new tag library.

This implementation calls the superclass implementation after determining that there is no other tag-lib registered for the given uri.

Parameters:
uri - Namespace URI to index the taglib.
taglib - The tag-lib to register.

registerTagLibrary

public void registerTagLibrary(java.lang.String namespaceURI,
                               java.lang.String className)
Register a new tag library.

This implementation calls the superclass implementation after determining that there is no other tag-lib registered for the given namespaceURI.

Parameters:
namespaceURI - Namespace URI to index the taglib.
className - The class name of the tag-lib to register.

getTagLibrary

public TagLibrary getTagLibrary(java.lang.String uri)
Retrieve a registered TagLibrary by namespace URI.

Parameters:
uri - The namespace URI of the tag-library.
Returns:
The matching tag-library, or null if none matches.

getVariable

public java.lang.Object getVariable(java.lang.String name)
Retrieve a variable.

Parameters:
name - The name of the variable.
Returns:
The value of the variable, if set, otherwise null.

getBoolean

public java.lang.Boolean getBoolean(java.lang.String key)
Convert a String property to a Boolean based on its contents. It would be nice if Jelly would deal with this automatically.

Parameters:
key - The property key to lookup and convert.
Returns:
The boolean value of the property if convertiable, otherwise Boolean.FALSE.

setMavenSession

public void setMavenSession(MavenSession mavenSession)
Set the mavenSession attribute.

Parameters:
mavenSession - the session for the context

getMavenSession

public MavenSession getMavenSession()
Get the mavenSession attribute.

Returns:
The

setMavenRepoRemotes

public void setMavenRepoRemotes(java.util.List mavenRepoRemote)

getMavenRepoRemote

public java.util.List getMavenRepoRemote()
Get the mavenRepoRemote attribute.

Returns:
The list of remote repositories.

setMavenRepoLocal

public void setMavenRepoLocal(java.lang.String mavenRepoLocal)
Set the location of the local maven repository.

Parameters:
mavenRepoLocal - The local repository.

getMavenRepoLocal

public java.lang.String getMavenRepoLocal()
Get the location of the local maven repository.

Returns:
The local repository.

setXMLOutput

public void setXMLOutput(XMLOutput xmlOutput)
Set the jelly output sink.

Parameters:
xmlOutput - The jelly output sink.

getXMLOutput

public XMLOutput getXMLOutput()
Get the jelly output sink.

Returns:
The jelly output sink.

setOnline

public void setOnline(java.lang.Boolean online)
Set the online flag.

Parameters:
online - The online flag.

getOnline

public java.lang.Boolean getOnline()
Get the online flag.

Returns:
The online flag.

setProject

public void setProject(Project project)
Set the maven project.

Parameters:
project - The maven project.

getProject

public Project getProject()
Get the maven project.

Returns:
The maven project.

setProxyHost

public void setProxyHost(java.lang.String proxyHost)
Set the proxy host.

Parameters:
proxyHost - The proxy host.

getProxyHost

public java.lang.String getProxyHost()
Get the proxy host.

Returns:
The proxy host.

setProxyPort

public void setProxyPort(java.lang.String proxyPort)
Set the proxy port.

Parameters:
proxyPort - The proxy port.

getProxyPort

public java.lang.String getProxyPort()
Get the proxy port.

Returns:
The proxy port.

setProxyUserName

public void setProxyUserName(java.lang.String proxyUserName)
Set the proxy user name.

Parameters:
proxyUserName - The user name setting for the proxy.

getProxyUserName

public java.lang.String getProxyUserName()
Get the proxy user name.

Returns:
The proxy user name.

setProxyPassword

public void setProxyPassword(java.lang.String proxyPassword)
Set the proxy password.

Parameters:
proxyPassword - The proxy password.

getProxyPassword

public java.lang.String getProxyPassword()
Get the proxy password.

Returns:
The ant project.

setDebugOn

public void setDebugOn(java.lang.Boolean debug)
Set the debug flag.

Parameters:
debug - The debug flag.

getDebugOn

public java.lang.Boolean getDebugOn()
Get the debug flag.

Returns:
The debug flag.

setEmacsModeOn

public void setEmacsModeOn(java.lang.Boolean emacsModeOn)
Set the emacs mode flag.

Parameters:
emacsModeOn - The emacs mode flag.

getEmacsModeOn

public java.lang.Boolean getEmacsModeOn()
Get the emacs mode flag.

Returns:
The emacs mode flag.

setRemoteRepositoryEnabled

public void setRemoteRepositoryEnabled(java.lang.Boolean remoteRepositoryEnabled)
Set flag indicating if the remote repository is enabled for use.

Parameters:
remoteRepositoryEnabled - Remote repository usage flag.

getRemoteRepositoryEnabled

public java.lang.Boolean getRemoteRepositoryEnabled()
Set flag indicating if the remote repository is enabled for use.

Returns:
Remote repository usage flag.

setMavenJarOverride

public void setMavenJarOverride(java.lang.Boolean mavenJarOverride)
Set the flag indicating the use of the JAR overriding facility.

Parameters:
mavenJarOverride - MavenSession jar override flag.

getMavenJarOverride

public java.lang.Boolean getMavenJarOverride()
Get the flag indicating the use of the JAR overriding facility.

Returns:
MavenSession jar override flag.

getMavenJarOverride

public java.lang.String getMavenJarOverride(java.lang.String id)
Get the maven jar override value for a particular dependency.

Parameters:
id - Id of the project to override.
Returns:
MavenSession jar override value for a particular dependency.

getMavenHome

public java.lang.String getMavenHome()
Get MavenSession home.

Returns:
MavenSession home.

setWerkzProject

public void setWerkzProject(WerkzProject werkzProject)
retrieve the werkz project object

Parameters:
werkzProject - Werkz Project

getWerkzProject

public WerkzProject getWerkzProject()
retrieve the werkz project object

Returns:
the Werkz Project

setAntProject

public void setAntProject(org.apache.tools.ant.Project antProject)
Set the ant project.

Parameters:
antProject - The proxy password.

getAntProject

public org.apache.tools.ant.Project getAntProject()
Get the ant project.

Returns:
The ant project.

display

public void display()
Display all maven variables


getMavenHomeLocal

public java.lang.String getMavenHomeLocal()
Get local maven home.

Returns:
location of Maven local home installation.

getPluginsDir

public java.lang.String getPluginsDir()
Get plugins location.

Returns:
plugins location.

getUserPluginsDir

public java.lang.String getUserPluginsDir()
Get user plugins location.

Returns:
user plugins location.

getUnpackedPluginsDir

public java.lang.String getUnpackedPluginsDir()
Get unpacked plugins location.

Returns:
unpacked plugins location.

setParent

public void setParent(JellyContext context)
See Also:
JellyContext.setParent(JellyContext)

resolveRelativePaths

public void resolveRelativePaths(java.io.File basedir)


Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.