You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jv...@apache.org on 2002/11/30 18:18:58 UTC

cvs commit: jakarta-turbine-maven/src/java/org/apache/maven/jelly MavenJellyContext.java

jvanzyl     2002/11/30 09:18:58

  Modified:    src/java/org/apache/maven/jelly MavenJellyContext.java
  Log:
  refactoring
  
  Revision  Changes    Path
  1.7       +287 -10   jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenJellyContext.java
  
  Index: MavenJellyContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenJellyContext.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MavenJellyContext.java	25 Nov 2002 17:43:53 -0000	1.6
  +++ MavenJellyContext.java	30 Nov 2002 17:18:58 -0000	1.7
  @@ -58,12 +58,17 @@
   
   import org.apache.commons.jelly.JellyContext;
   import org.apache.commons.jelly.TagLibrary;
  +import org.apache.commons.jelly.XMLOutput;
   import org.apache.commons.jelly.expression.Expression;
  +import org.apache.commons.grant.GrantProject;
   import org.apache.maven.MavenConstants;
   import org.apache.maven.app.PluginManager;
  +import org.apache.maven.app.ProjectVerifier;
  +import org.apache.maven.project.Project;
   
   import java.net.URL;
   import java.util.HashSet;
  +import java.util.List;
   import java.util.Set;
   
   /** Specialized version of a <code>JellyContext</code>.
  @@ -85,7 +90,7 @@
       extends JellyContext
   {
       // ----------------------------------------------------------------------
  -    //     Instance members
  +    // I N S T A N C E  M E M B E R S
       // ----------------------------------------------------------------------
   
       /** Taglibs caught. */
  @@ -95,7 +100,7 @@
       private Set lazyTagLibs;
   
       // ----------------------------------------------------------------------
  -    //     Constructors
  +    // C O N S T R U C T O R S
       // ----------------------------------------------------------------------
   
       /** Construct.
  @@ -130,7 +135,7 @@
       }
   
       // ----------------------------------------------------------------------
  -    //     Instance methods
  +    // I N S T A N C E  M E T H O D S
       // ----------------------------------------------------------------------
   
       /** Create a child <code>JellyContext</code>.
  @@ -197,7 +202,7 @@
           {
               try
               {
  -                ( (PluginManager) getVariable( MavenConstants.PLUGIN_MANAGER ) ).prepForTagLibrary( namespaceURI );
  +                getPluginManager().prepForTagLibrary( namespaceURI );
                   lazyTagLibs.remove( namespaceURI );
               }
               catch ( Exception e )
  @@ -259,18 +264,290 @@
       public Boolean getBoolean( String propValue )
       {
           if ( "true".equalsIgnoreCase( propValue )
  -             || "on".equalsIgnoreCase( propValue )
  -             || "1".equals( propValue ) )
  +            || "on".equalsIgnoreCase( propValue )
  +            || "1".equals( propValue ) )
           {
               return Boolean.TRUE;
           }
  -        else if ( "false".equalsIgnoreCase( propValue ) 
  -                  ||  "off".equalsIgnoreCase( propValue )
  -                  || "0".equals( propValue ) )
  +        else if ( "false".equalsIgnoreCase( propValue )
  +            || "off".equalsIgnoreCase( propValue )
  +            || "0".equals( propValue ) )
           {
               return Boolean.FALSE;
           }
   
           return null;
  +    }
  +
  +    // ----------------------------------------------------------------------
  +    // A C C E S S O R S
  +    // ----------------------------------------------------------------------
  +
  +    /**
  +     * Add a remote repository to the list of remote repositories.
  +     *
  +     * @param mavenRemoteRepo Remote repository to add.
  +     */
  +    public void addMavenRemoteRepo( String mavenRemoteRepo )
  +    {
  +        ( (List) getVariable( MavenConstants.REPO_REMOTE ) ).add( mavenRemoteRepo );
  +    }
  +
  +    /**
  +     * Set the mavenRepoRemote attribute.
  +     *
  +     * @param mavenRepoRemote
  +     */
  +    public void setMavenRepoRemotes( List mavenRepoRemote )
  +    {
  +        setVariable( MavenConstants.REPO_REMOTE, mavenRepoRemote );
  +    }
  +
  +    /**
  +     * Get the mavenRepoRemote attribute.
  +     *
  +     * @return The
  +     */
  +    public List getMavenRepoRemote()
  +    {
  +        return (List) getVariable( MavenConstants.REPO_REMOTE );
  +    }
  +
  +    /**
  +     * Set the mavenRepoRemote attribute.
  +     *
  +     * @param mavenRepoLocal
  +     */
  +    public void setMavenRepoLocal( String mavenRepoLocal )
  +    {
  +        setVariable( MavenConstants.REPO_LOCAL, mavenRepoLocal );
  +    }
  +
  +    /**
  +     * Get the mavenRepoRemote attribute.
  +     *
  +     * @return The
  +     */
  +    public String getMavenRepoLocal()
  +    {
  +        return (String) getVariable( MavenConstants.REPO_LOCAL );
  +    }
  +
  +
  +    /**
  +     * Set the project verifier.
  +     *
  +     * @param projectVerifier The project verifier.
  +     */
  +    public void setProjectVerifier( ProjectVerifier projectVerifier )
  +    {
  +        setVariable( MavenConstants.MAVEN_PROJECT_VERIFIER, projectVerifier );
  +    }
  +
  +    /**
  +     * Get the project verifier.
  +     *
  +     * @return The project verifier.
  +     */
  +    public ProjectVerifier getProjectVerifier()
  +    {
  +        return (ProjectVerifier) getVariable( MavenConstants.MAVEN_PROJECT_VERIFIER );
  +    }
  +
  +    /**
  +     * Set the jelly output sink.
  +     *
  +     * @param xmlOutput The jelly output sink.
  +     */
  +    public void setXMLOutput( XMLOutput xmlOutput )
  +    {
  +        setVariable( MavenConstants.XML_OUTPUT, xmlOutput );
  +    }
  +
  +    /**
  +     * Get the jelly output sink.
  +     *
  +     * @return The jelly output sink.
  +     */
  +    public XMLOutput getXMLOutput()
  +    {
  +        return (XMLOutput) getVariable( MavenConstants.XML_OUTPUT );
  +    }
  +
  +    /**
  +     * Set the online flag.
  +     *
  +     * @param online The online flag.
  +     */
  +    public void setOnline( Boolean online )
  +    {
  +        setVariable( MavenConstants.ONLINE, online );
  +    }
  +
  +    /**
  +     * Get the online flag.
  +     *
  +     * @return The online flag.
  +     */
  +    public Boolean getOnline()
  +    {
  +        return (Boolean) getVariable( MavenConstants.ONLINE );
  +    }
  +
  +    /**
  +     * Set the maven project.
  +     *
  +     * @param project The maven project.
  +     */
  +    public void setProject( Project project )
  +    {
  +        setVariable( MavenConstants.MAVEN_POM, project );
  +    }
  +
  +    /**
  +     * Get the maven project.
  +     *
  +     * @return The maven project.
  +     */
  +    public Project getProject()
  +    {
  +        return (Project) getVariable( MavenConstants.MAVEN_POM );
  +    }
  +
  +    /**
  +     * Set the proxy host.
  +     *
  +     * @param proxyHost The proxy host.
  +     */
  +    public void setProxyHost( String proxyHost )
  +    {
  +        setVariable( MavenConstants.PROXY_HOST, proxyHost );
  +    }
  +
  +    /**
  +     * Get the proxy host.
  +     *
  +     * @return The proxy host.
  +     */
  +    public String getProxyHost()
  +    {
  +        return (String) getVariable( MavenConstants.PROXY_HOST );
  +    }
  +
  +    /**
  +     * Set the proxy port.
  +     *
  +     * @param proxyPort The proxy port.
  +     */
  +    public void setProxyPort( String proxyPort )
  +    {
  +        setVariable( MavenConstants.PROXY_PORT, proxyPort );
  +    }
  +
  +    /**
  +     * Get the proxy port.
  +     *
  +     * @return The proxy port.
  +     */
  +    public String getProxyPort()
  +    {
  +        return (String) getVariable( MavenConstants.PROXY_PORT );
  +    }
  +
  +    /**
  +     *  Set the proxy user name.
  +     *
  +     * @param proxyUserName
  +     */
  +    public void setProxyUserName( String proxyUserName )
  +    {
  +        setVariable( MavenConstants.PROXY_USERNAME, proxyUserName );
  +    }
  +
  +    /**
  +     * Get the proxy user name.
  +     *
  +     * @return The proxy user name.
  +     */
  +    public String getProxyUserName()
  +    {
  +        return (String) getVariable( MavenConstants.PROXY_USERNAME );
  +    }
  +
  +    /**
  +     * Set the proxy password.
  +     *
  +     * @param proxyPassword The proxy password.
  +     */
  +    public void setProxyPassword( String proxyPassword )
  +    {
  +        setVariable( MavenConstants.PROXY_HOST, proxyPassword );
  +    }
  +
  +    /**
  +     * Get the proxy password.
  +     *
  +     * @return The ant project.
  +     */
  +    public String getProxyPassword()
  +    {
  +        return (String) getVariable( MavenConstants.PROXY_PASSWORD );
  +    }
  +
  +    /**
  +     * Set the ant project.
  +     *
  +     * @param antProject The proxy password.
  +     */
  +    public void setAntProject( GrantProject antProject )
  +    {
  +        setVariable( MavenConstants.MAVEN_ANT_PROJECT, antProject );
  +    }
  +
  +    /**
  +     * Get the ant project.
  +     *
  +     * @return The ant project.
  +     */
  +    public GrantProject getAntProject()
  +    {
  +        return (GrantProject) getVariable( MavenConstants.MAVEN_ANT_PROJECT );
  +    }
  +
  +    public void setDebugOn( Boolean debug )
  +    {
  +        setVariable( MavenConstants.DEBUG_ON, debug );
  +    }
  +
  +    public Boolean getDebugOn()
  +    {
  +        return (Boolean) getVariable( MavenConstants.DEBUG_ON );
  +    }
  +
  +    public void setPluginManager( PluginManager pluginManager )
  +    {
  +        setVariable( MavenConstants.PLUGIN_MANAGER, pluginManager );
  +    }
  +
  +    public PluginManager getPluginManager()
  +    {
  +        return (PluginManager) getVariable( MavenConstants.PLUGIN_MANAGER );
  +    }
  +
  +   /**
  +     * retrieve the werkz project object
  +     * @param werkzProject {@link com.werken.werkz.Project Werkz Project}
  +     */
  +    public void setWerkzProject( com.werken.werkz.Project werkzProject )
  +    {
  +        setVariable( MavenConstants.WERKZ_PROJECT, werkzProject );
  +    }
  +    /**
  +     * retrieve the werkz project object
  +     * @return the {@link com.werken.werkz.Project Werkz Project}
  +     */
  +    public com.werken.werkz.Project getWerkzProject()
  +    {
  +        return (com.werken.werkz.Project) getVariable( MavenConstants.WERKZ_PROJECT );
       }
   }