werken      2002/11/25 09:43:53

  Modified:    .        project.properties
               src/java/org/apache/maven/jelly BaseTagLibrary.java
                        MavenExpressionFactory.java MavenJellyContext.java
  Log:
  Fixing checkstyle violations.
  
  Tweaked the const regexp to allow our 'log'.
  
  Revision  Changes    Path
  1.32      +1 -1      jakarta-turbine-maven/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/project.properties,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- project.properties        24 Nov 2002 19:45:44 -0000      1.31
  +++ project.properties        25 Nov 2002 17:43:53 -0000      1.32
  @@ -25,7 +25,7 @@
   
   checkstyle.header.file = LICENSE.txt
   checkstyle.header.ignoreline = 1,2,3,4,5,6
  -checkstyle.const.pattern = ^[a-zA-Z][a-zA-Z0-9_]*$
  +checkstyle.pattern.const = log|^[a-zA-Z][a-zA-Z0-9_]*$
   
   # -------------------------------------------------------------------
   # J A V A D O C  P R O P E R T I E S
  
  
  
  1.6       +1 -5      
jakarta-turbine-maven/src/java/org/apache/maven/jelly/BaseTagLibrary.java
  
  Index: BaseTagLibrary.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/BaseTagLibrary.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BaseTagLibrary.java       25 Nov 2002 00:40:14 -0000      1.5
  +++ BaseTagLibrary.java       25 Nov 2002 17:43:53 -0000      1.6
  @@ -56,10 +56,6 @@
    * ====================================================================
    */
   
  -import org.apache.commons.jelly.expression.CompositeExpression;
  -import org.apache.commons.jelly.expression.Expression;
  -import org.apache.commons.jelly.expression.ExpressionFactory;
  -import org.apache.commons.jelly.impl.TagScript;
   import org.apache.commons.jelly.tags.core.CoreTagLibrary;
   
   /**
  
  
  
  1.4       +69 -6     
jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenExpressionFactory.java
  
  Index: MavenExpressionFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenExpressionFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MavenExpressionFactory.java       24 Nov 2002 19:00:38 -0000      1.3
  +++ MavenExpressionFactory.java       25 Nov 2002 17:43:53 -0000      1.4
  @@ -1,5 +1,61 @@
   package org.apache.maven.jelly;
   
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Apache" and "Apache Software Foundation" and
  + *    "Apache Maven" must not be used to endorse or promote products
  + *    derived from this software without prior written permission. For
  + *    written permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    "Apache Maven", nor may "Apache" appear in their name, without
  + *    prior written permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + *
  + * ====================================================================
  + */
  +
   import org.apache.commons.jelly.JellyContext;
   import org.apache.commons.jelly.expression.Expression;
   import org.apache.commons.jelly.expression.ExpressionFactory;
  @@ -19,16 +75,17 @@
   public class MavenExpressionFactory
       implements ExpressionFactory
   {
  +    // ----------------------------------------------------------------------
  +    //     Instance members
  +    // ----------------------------------------------------------------------
  +
       /**
        * whether we should allow Ant-style expresssions, using dots as part of
        * variable name
        */
       private boolean supportAntVariables = true;
   
  -    // ExpressionFactory interface
  -    //-------------------------------------------------------------------------
  -    /**
  -     * Description of the Method
  +    /** @see ExpressionFactory
        */
       public Expression createExpression( final String text )
           throws Exception
  @@ -89,6 +146,9 @@
       /**
        * Sets whether we should allow Ant-style expresssions, using dots as part
        * of variable name
  +     *
  +     * @param supportAntVariable <code>true</code> to indicate that ant variable
  +     *        should be supported, otherwise <code>false</code>.
        */
       public void setSupportAntVariables( boolean supportAntVariables )
       {
  @@ -98,7 +158,10 @@
       // Implementation methods
       //-------------------------------------------------------------------------
   
  -    /**
  +    /** Determine if a variable name is a valid ant variable name.
  +     *
  +     * @param text The text to test.
  +     *
        * @return true if the given string is a valid Ant variable name, typically
        *      thats alphanumeric text with '.' etc.
        */
  
  
  
  1.6       +41 -8     
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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MavenJellyContext.java    24 Nov 2002 19:00:38 -0000      1.5
  +++ MavenJellyContext.java    25 Nov 2002 17:43:53 -0000      1.6
  @@ -84,12 +84,22 @@
   public class MavenJellyContext
       extends JellyContext
   {
  +    // ----------------------------------------------------------------------
  +    //     Instance members
  +    // ----------------------------------------------------------------------
  +
       /** Taglibs caught. */
       private Set tagLibUris;
   
       /** Lazy taglib uris. */
       private Set lazyTagLibs;
   
  +    // ----------------------------------------------------------------------
  +    //     Constructors
  +    // ----------------------------------------------------------------------
  +
  +    /** Construct.
  +     */
       public MavenJellyContext()
       {
           super();
  @@ -119,6 +129,14 @@
           this.lazyTagLibs = new HashSet();
       }
   
  +    // ----------------------------------------------------------------------
  +    //     Instance methods
  +    // ----------------------------------------------------------------------
  +
  +    /** Create a child <code>JellyContext</code>.
  +     *
  +     *  @return The new child context.
  +     */
       protected JellyContext createChildContext()
       {
           return new MavenJellyContext( this );
  @@ -167,6 +185,12 @@
           }
       }
   
  +    /** Retrieve a registered <code>TagLibrary</code> by namespace URI.
  +     *
  +     *  @param namespaceURI The namespace URI of the tag-library.
  +     *
  +     *  @return The matching tag-library, or <code>null</code> if none matches.
  +     */
       public TagLibrary getTagLibrary( String namespaceURI )
       {
           if ( this.lazyTagLibs.contains( namespaceURI ) )
  @@ -185,6 +209,10 @@
           return super.getTagLibrary( namespaceURI );
       }
   
  +    /** Set the URIs of lazily-loadable <code>TagLibrary</code>s.
  +     *
  +     *  @param uris The lazily-loadable tag-library URIs.
  +     */
       public void addLazyTagLibraries( Set uris )
       {
           this.lazyTagLibs.addAll( uris );
  @@ -222,18 +250,23 @@
        * Convert a <code>String</code> property to a
        * <code>Boolean</code> based on its contents.  It would be nice
        * if Jelly would deal with this automatically.
  +     *
  +     *  @param propValue The property value to convert.
  +     *
  +     *  @return The boolean value of the property if convertiable,
  +     *          otherwise <code>null</code>.
        */
  -    public Boolean getBoolean( String s )
  +    public Boolean getBoolean( String propValue )
       {
  -        if ( "true".equalsIgnoreCase( s ) ||
  -            "on".equalsIgnoreCase( s ) ||
  -            "1".equals( s ) )
  +        if ( "true".equalsIgnoreCase( propValue )
  +             || "on".equalsIgnoreCase( propValue )
  +             || "1".equals( propValue ) )
           {
               return Boolean.TRUE;
           }
  -        else if ( "false".equalsIgnoreCase( s ) ||
  -            "off".equalsIgnoreCase( s ) ||
  -            "0".equals( s ) )
  +        else if ( "false".equalsIgnoreCase( propValue ) 
  +                  ||  "off".equalsIgnoreCase( propValue )
  +                  || "0".equals( propValue ) )
           {
               return Boolean.FALSE;
           }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to