tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-tapestry/junit/context36 README Home.html Home.page
Date Thu, 29 Jul 2004 15:04:40 GMT
hlship      2004/07/29 08:04:40

  Modified:    framework/src/org/apache/tapestry/engine Tag: branch-3-0
                        TemplateParserDelegateImpl.java
               .        Tag: branch-3-0 status.xml
               framework/src/org/apache/tapestry/enhance Tag: branch-3-0
                        ComponentClassFactory.java BaseEnhancedClass.java
                        IEnhancedClass.java
  Added:       junit/mock-scripts Tag: branch-3-0 TestAbstractClass.xml
               junit/src/context36 Tag: branch-3-0 Home.java
               framework/src/org/apache/tapestry/enhance Tag: branch-3-0
                        NoOpEnhancer.java
               junit/context36 Tag: branch-3-0 README Home.html Home.page
  Log:
  [26967] Allow abstract pages/components even if no specified properties (or other enhancements)
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.1   +32 -0     jakarta-tapestry/junit/mock-scripts/Attic/TestAbstractClass.xml
  
  
  
  
  No                   revision
  No                   revision
  1.1.2.2   +10 -10    jakarta-tapestry/framework/src/org/apache/tapestry/engine/Attic/TemplateParserDelegateImpl.java
  
  Index: TemplateParserDelegateImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/engine/Attic/TemplateParserDelegateImpl.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- TemplateParserDelegateImpl.java	22 Jul 2004 14:19:37 -0000	1.1.2.1
  +++ TemplateParserDelegateImpl.java	29 Jul 2004 15:04:39 -0000	1.1.2.2
  @@ -1,16 +1,16 @@
  -//Copyright 2004 The Apache Software Foundation
  +//  Copyright 2004 The Apache Software Foundation
   //
  -//Licensed under the Apache License, Version 2.0 (the "License");
  -//you may not use this file except in compliance with the License.
  -//You may obtain a copy of the License at
  +// Licensed under the Apache License, Version 2.0 (the "License");
  +// you may not use this file except in compliance with the License.
  +// You may obtain a copy of the License at
   //
  -//	http://www.apache.org/licenses/LICENSE-2.0
  +//     http://www.apache.org/licenses/LICENSE-2.0
   //
  -//Unless required by applicable law or agreed to in writing, software
  -//distributed under the License is distributed on an "AS IS" BASIS,
  -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  -//See the License for the specific language governing permissions and
  -//limitations under the License.
  +// Unless required by applicable law or agreed to in writing, software
  +// distributed under the License is distributed on an "AS IS" BASIS,
  +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  +// See the License for the specific language governing permissions and
  +// limitations under the License.
   
   package org.apache.tapestry.engine;
   
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +31 -0     jakarta-tapestry/junit/src/context36/Attic/Home.java
  
  
  
  
  No                   revision
  No                   revision
  1.47.2.5  +4 -0      jakarta-tapestry/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/status.xml,v
  retrieving revision 1.47.2.4
  retrieving revision 1.47.2.5
  diff -u -r1.47.2.4 -r1.47.2.5
  --- status.xml	29 Jul 2004 14:11:15 -0000	1.47.2.4
  +++ status.xml	29 Jul 2004 15:04:39 -0000	1.47.2.5
  @@ -270,6 +270,10 @@
         Palette does not clear its selected list when no selections are made.
       </action>
       
  +    <action type="fix" dev="HLS" fixes-bug="26967">
  +      Allow abstract pages/components even if no specified properties (or other enhancements)
  +    </action>
  +    
     </release>	
      
    	<release version="3.0" date="Apr 18 2004">
  
  
  
  No                   revision
  No                   revision
  1.23.2.1  +47 -41    jakarta-tapestry/framework/src/org/apache/tapestry/enhance/ComponentClassFactory.java
  
  Index: ComponentClassFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/enhance/ComponentClassFactory.java,v
  retrieving revision 1.23
  retrieving revision 1.23.2.1
  diff -u -r1.23 -r1.23.2.1
  --- ComponentClassFactory.java	19 Feb 2004 17:37:52 -0000	1.23
  +++ ComponentClassFactory.java	29 Jul 2004 15:04:39 -0000	1.23.2.1
  @@ -41,7 +41,6 @@
    *  Internally, this class makes use of {@link IEnhancedClassFactory}.
    *
    *  @author Howard Lewis Ship
  - *  @version $Id$
    *  @since 3.0
    *
    **/
  @@ -64,7 +63,7 @@
        *  Mapping between a primitive type and its Java VM representation
        *  Used for the encoding of array types
        **/
  -    private static Map _primitiveTypes = new HashMap();  
  +    private static Map _primitiveTypes = new HashMap();
   
       static {
           _primitiveTypes.put("boolean", "Z");
  @@ -77,7 +76,6 @@
           _primitiveTypes.put("byte", "B");
       }
   
  -
       private IResourceResolver _resolver;
   
       private IEnhancedClassFactory _enhancedClassFactory;
  @@ -149,16 +147,16 @@
           return _enhancedClass != null && _enhancedClass.hasModifications();
       }
   
  -	/**
  -	 * @return true if pd is not null and both read/write methods are implemented
  -	 */
  -	public boolean isImplemented(PropertyDescriptor pd)
  -	{
  -		if (pd == null)
  -			return false;
  -		
  -		return isImplemented(pd.getReadMethod()) && isImplemented(pd.getWriteMethod());
  -	}
  +    /**
  +     * @return true if pd is not null and both read/write methods are implemented
  +     */
  +    public boolean isImplemented(PropertyDescriptor pd)
  +    {
  +        if (pd == null)
  +            return false;
  +
  +        return isImplemented(pd.getReadMethod()) && isImplemented(pd.getWriteMethod());
  +    }
   
       /**
        * @return true if m is not null and is abstract.
  @@ -171,16 +169,16 @@
           return Modifier.isAbstract(m.getModifiers());
       }
   
  -	/**
  -	 * @return true if m is not null and not abstract  
  -	 */
  -	public boolean isImplemented(Method m)
  -	{
  -		if (m == null)
  -		    return false;
  -		
  -		return !Modifier.isAbstract(m.getModifiers()); 
  -	}
  +    /**
  +     * @return true if m is not null and not abstract  
  +     */
  +    public boolean isImplemented(Method m)
  +    {
  +        if (m == null)
  +            return false;
  +
  +        return !Modifier.isAbstract(m.getModifiers());
  +    }
   
       /**
        *  Given a class name, returns the corresponding class.  In addition,
  @@ -210,7 +208,7 @@
                       location,
                       ex);
               }
  -            
  +
               _classMapping.recordType(type, result);
           }
   
  @@ -223,7 +221,7 @@
        *  int[][] is translated to [[I and java.lang.Object[] to 
        *  [Ljava.lang.Object;   
        *  This method and its static Map should go into a utility class
  -     */   
  +     */
       protected String translateClassName(String type)
       {
           // if it is not an array, just return the type itself
  @@ -231,13 +229,14 @@
               return type;
   
           // if it is an array, convert it to JavaVM-style format
  -        StringBuffer javaType = new StringBuffer(); 
  -        while (type.endsWith("[]")) {
  +        StringBuffer javaType = new StringBuffer();
  +        while (type.endsWith("[]"))
  +        {
               javaType.append("[");
               type = type.substring(0, type.length() - 2);
           }
  -        
  -        String primitiveIdentifier = (String) _primitiveTypes.get(type); 
  +
  +        String primitiveIdentifier = (String) _primitiveTypes.get(type);
           if (primitiveIdentifier != null)
               javaType.append(primitiveIdentifier);
           else
  @@ -334,8 +333,7 @@
                       + " for "
                       + _specification.getSpecificationLocation());
   
  -        Class result;
  -        result = enhancedClass.createEnhancedSubclass();
  +        Class result = enhancedClass.createEnhancedSubclass();
   
           if (LOG.isDebugEnabled())
               LOG.debug("Finished creating enhanced class " + subclassName);
  @@ -354,6 +352,14 @@
       {
           scanForParameterEnhancements();
           scanForSpecifiedPropertyEnhancements();
  +        scanForAbstractClass();
  +    }
  +
  +    protected void scanForAbstractClass()
  +    {
  +        if (Modifier.isAbstract(_componentClass.getModifiers()))
  +            getEnhancedClass().addEnhancer(new NoOpEnhancer());
  +
       }
   
       /**
  @@ -401,16 +407,16 @@
           String propertyName = parameterName + Tapestry.PARAMETER_PROPERTY_NAME_SUFFIX;
           PropertyDescriptor pd = getPropertyDescriptor(propertyName);
   
  -		// only enhance custom parameter binding properties if they are declared abstract
  -		if (ps.getDirection() == Direction.CUSTOM)
  -		{
  -		    if (pd == null)
  -			    return;
  -			
  -			if (!(isAbstract(pd.getReadMethod()) || isAbstract(pd.getWriteMethod())))
  -			    return;
  -		}
  -			
  +        // only enhance custom parameter binding properties if they are declared abstract
  +        if (ps.getDirection() == Direction.CUSTOM)
  +        {
  +            if (pd == null)
  +                return;
  +
  +            if (!(isAbstract(pd.getReadMethod()) || isAbstract(pd.getWriteMethod())))
  +                return;
  +        }
  +
           if (isImplemented(pd))
               return;
   
  
  
  
  1.3.2.1   +3 -3      jakarta-tapestry/framework/src/org/apache/tapestry/enhance/BaseEnhancedClass.java
  
  Index: BaseEnhancedClass.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/enhance/BaseEnhancedClass.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- BaseEnhancedClass.java	19 Feb 2004 17:37:52 -0000	1.3
  +++ BaseEnhancedClass.java	29 Jul 2004 15:04:40 -0000	1.3.2.1
  @@ -38,7 +38,7 @@
           return _enhancers;
       }
   
  -    protected void addEnhancer(IEnhancer enhancer)
  +    public void addEnhancer(IEnhancer enhancer)
       {
           if (_enhancers == null)
               _enhancers = new ArrayList();
  @@ -57,7 +57,7 @@
       public void performEnhancement()
       {
           List enhancers = getEnhancers();
  -        
  +
           if (enhancers == null)
               return;
   
  
  
  
  1.3.2.1   +8 -1      jakarta-tapestry/framework/src/org/apache/tapestry/enhance/IEnhancedClass.java
  
  Index: IEnhancedClass.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/enhance/IEnhancedClass.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- IEnhancedClass.java	19 Feb 2004 17:37:52 -0000	1.3
  +++ IEnhancedClass.java	29 Jul 2004 15:04:40 -0000	1.3.2.1
  @@ -20,13 +20,15 @@
    *  and is specific to the selected system of enhancement.
    * 
    *  @author Mindbridge
  - *  @version $Id$
    *  @since 3.0
    */
   public interface IEnhancedClass
   {
       String getClassName();
       
  +    /**
  +     * Adds an enhancer for creating the specified property.
  +     */
       void createProperty(String propertyName, String propertyType);
   
       void createProperty(
  @@ -44,4 +46,9 @@
       boolean hasModifications();
   
       Class createEnhancedSubclass();
  +    
  +    /**
  +     * Adds an arbitrary enhancer.
  +     */
  +    void addEnhancer(IEnhancer enhancer);
   }
  
  
  
  No                   revision
  
  Index: IEnhancedClass.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/enhance/IEnhancedClass.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- IEnhancedClass.java	19 Feb 2004 17:37:52 -0000	1.3
  +++ IEnhancedClass.java	29 Jul 2004 15:04:40 -0000	1.3.2.1
  @@ -20,13 +20,15 @@
    *  and is specific to the selected system of enhancement.
    * 
    *  @author Mindbridge
  - *  @version $Id$
    *  @since 3.0
    */
   public interface IEnhancedClass
   {
       String getClassName();
       
  +    /**
  +     * Adds an enhancer for creating the specified property.
  +     */
       void createProperty(String propertyName, String propertyType);
   
       void createProperty(
  @@ -44,4 +46,9 @@
       boolean hasModifications();
   
       Class createEnhancedSubclass();
  +    
  +    /**
  +     * Adds an arbitrary enhancer.
  +     */
  +    void addEnhancer(IEnhancer enhancer);
   }
  
  
  
  No                   revision
  
  Index: IEnhancedClass.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/enhance/IEnhancedClass.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- IEnhancedClass.java	19 Feb 2004 17:37:52 -0000	1.3
  +++ IEnhancedClass.java	29 Jul 2004 15:04:40 -0000	1.3.2.1
  @@ -20,13 +20,15 @@
    *  and is specific to the selected system of enhancement.
    * 
    *  @author Mindbridge
  - *  @version $Id$
    *  @since 3.0
    */
   public interface IEnhancedClass
   {
       String getClassName();
       
  +    /**
  +     * Adds an enhancer for creating the specified property.
  +     */
       void createProperty(String propertyName, String propertyType);
   
       void createProperty(
  @@ -44,4 +46,9 @@
       boolean hasModifications();
   
       Class createEnhancedSubclass();
  +    
  +    /**
  +     * Adds an arbitrary enhancer.
  +     */
  +    void addEnhancer(IEnhancer enhancer);
   }
  
  
  
  1.1.2.1   +35 -0     jakarta-tapestry/framework/src/org/apache/tapestry/enhance/Attic/NoOpEnhancer.java
  
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +1 -0      jakarta-tapestry/junit/context36/Attic/README
  
  
  
  
  1.1.2.1   +1 -0      jakarta-tapestry/junit/context36/Attic/Home.html
  
  
  
  
  1.1.2.1   +24 -0     jakarta-tapestry/junit/context36/Attic/Home.page
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message