commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmi...@apache.org
Subject cvs commit: jakarta-commons-sandbox/clazz/xdocs/stylesheets project.xml
Date Thu, 09 Jan 2003 03:24:02 GMT
dmitri      2003/01/08 19:24:02

  Modified:    clazz    build.properties.sample build.xml
               clazz/src/java/org/apache/commons/clazz Clazz.java
                        ClazzLoader.java ClazzLoaderFactory.java
               clazz/src/java/org/apache/commons/clazz/bean
                        BeanClazzLoader.java BeanClazzOperation.java
                        BeanGroupClazzLoader.java
               clazz/src/java/org/apache/commons/clazz/common
                        ClazzLoaderFactorySupport.java
                        ExtendedClazzLoaderFactory.java
                        GroupClazzLoader.java
                        StandardClazzLoaderFactory.java
               clazz/src/java/org/apache/commons/clazz/reflect
                        ReflectedClazz.java ReflectedClazzLoader.java
                        ReflectedGroupClazzLoader.java
               clazz/src/java/org/apache/commons/clazz/reflect/common
                        AccessorMethodParser.java
                        ReflectedConstructorInstanceFactoryIntrospector.java
                        ReflectedListPropertyIntrospectorSupport.java
                        ReflectedMethodInstanceFactoryIntrospector.java
                        ReflectedMethodOperation.java
                        ReflectedMethodOperationIntrospector.java
                        ReflectedScalarPropertyIntrospector.java
               clazz/src/java/org/apache/commons/clazz/reflect/extended
                        ExtendedReflectedClazzLoader.java
                        ExtendedReflectedListPropertyIntrospector.java
                        ReflectedMappedPropertyIntrospector.java
               clazz/src/java/org/apache/commons/clazz/reflect/standard
                        StandardReflectedClazzLoader.java
                        StandardReflectedListPropertyIntrospector.java
               clazz/src/test/org/apache/commons/clazz/bean
                        BeanClazzLoaderTest.java BeanClazzTest.java
               clazz/src/test/org/apache/commons/clazz/reflect
                        ReflectedClazzTestSupport.java
               clazz/src/test/org/apache/commons/clazz/reflect/extended
                        ExtendedReflectedClazzTest.java
                        ExtendedReflectedInstanceFactoryTest.java
                        ExtendedReflectedListPropertyTest.java
                        ExtendedReflectedOperationTest.java
                        ReflectedMappedPropertyTest.java
               clazz/src/test/org/apache/commons/clazz/reflect/standard
                        StandardReflectedClazzTest.java
                        StandardReflectedInstanceFactoryTest.java
                        StandardReflectedListPropertyTest.java
                        StandardReflectedOperationTest.java
  Added:       clazz    project.xml
               clazz/src/java/org/apache/commons/clazz
                        ModelClazzLoader.java
               clazz/src/java/org/apache/commons/clazz/reflect/extended
                        ExtendedReflectedClazz.java
               clazz/src/java/org/apache/commons/clazz/reflect/standard
                        StandardReflectedClazz.java
               clazz/src/test/org/apache/commons/clazz/reflect
                        ReflectedClazzTestCommon.java
                        ReflectedInstanceFactoryTestCommon.java
                        ReflectedListPropertyTestCommon.java
                        ReflectedOperationCommon.java
               clazz/src/test/org/apache/commons/clazz/reflect/extended
                        CustomBean1.java CustomBean1ExtendedClazz.java
                        CustomBean1ExtendedClazzTest.java CustomBean2.java
                        CustomClazz.java CustomClazzLoader.java
                        CustomClazzLoaderTest.java
                        CustomPropertyIntrospector.java
               clazz/xdocs overview.xml
               clazz/xdocs/images design.jpg jakarta-logo.gif
                        logo-for-anakia.gif logo.jpg
               clazz/xdocs/stylesheets project.xml
  Removed:     clazz/src/java/org/apache/commons/clazz/common
                        CachingGroupClazzLoader.java
               clazz/src/test/org/apache/commons/clazz/reflect
                        ReflectedClazzTest.java
                        ReflectedInstanceFactoryTest.java
                        ReflectedListPropertyTestSupport.java
                        ReflectedOperationTest.java
  Log:
  Mavenized and refactored some customization points
  
  Revision  Changes    Path
  1.2       +12 -5     jakarta-commons-sandbox/clazz/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/build.properties.sample,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build.properties.sample	24 Oct 2002 23:05:34 -0000	1.1
  +++ build.properties.sample	9 Jan 2003 03:23:58 -0000	1.2
  @@ -1,6 +1,13 @@
  -# The directory containing your binary distribution of JUnit, 
  -# version 3.7 or later
  -junit.home = /usr/local/junit3.7
  +lib.repo=c:/Frameworks
  +
  +jaxp.jaxp.jar=${lib.repo}/jaxp-1.1.jar
  +jaxp.xslt.jar=${lib.repo}/xalan.jar
  +servlet.jar=${lib.repo}/servlet.jar
  +
  +commons-collections.jar=${lib.repo}/commons-collections.jar
  +commons-beanutils.jar=${lib.repo}/commons-beanutils.jar
  +commons-logging.jar=${lib.repo}/commons-logging.jar
  +velocity.jar=${lib.repo}/velocity-1.3.jar
  +jdom.jar=${lib.repo}/jdom-b8.jar
  +logkit.jar=${lib.repo}/logkit-1.0.jar
   
  -# The pathname of the "junit.jar" JAR file
  -junit.jar = ${junit.home}/junit.jar
  
  
  
  1.3       +4 -5      jakarta-commons-sandbox/clazz/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/build.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- build.xml	14 Dec 2002 02:37:43 -0000	1.2
  +++ build.xml	9 Jan 2003 03:23:58 -0000	1.3
  @@ -202,10 +202,10 @@
      description="Create component Javadoc documentation">
       <mkdir      dir="${dist.home}"/>
       <mkdir      dir="${dist.home}/docs"/>
  -    <mkdir      dir="${dist.home}/docs/api"/>
  +    <mkdir      dir="${dist.home}/docs/apidocs"/>
       <javadoc sourcepath="${source.home}"
              classpathref="compile.classpath"
  -                destdir="${dist.home}/docs/api"
  +                destdir="${dist.home}/docs/apidocs"
              packagenames="org.apache.commons.*"
                    author="true"
                   private="false"
  @@ -295,11 +295,10 @@
          ######################################################################
          </echo>
   
  -<!--      <cvs cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic"
  +      <cvs cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic"
             command="checkout -p jakarta-site2/xdocs/stylesheets/site.vsl"
             output="${docs.src}/stylesheets/site.vsl"
         />
  --->
     </target>
   
     <target name="xdoc" depends="xdoc.fetch-stylesheet"
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project>
    <extend>../project.xml</extend>
    <name>Clazz</name>
    <id>commons-clazz</id>
    <currentVersion>1.0-alpha1</currentVersion>
    <inceptionYear>2002</inceptionYear>
    <shortDescription>Runtime Metadata</shortDescription>
    <description>A package for handling runtime information about types (including Java classes)</description>
  
    <versions>
      <version>
        <id>a1</id>
        <name>0.8-a1</name>
        <tag>CLAZZ_1_0_A1</tag>
      </version>
    </versions>
  
    <developers>
      <developer>
        <name>Dmitri Plotnikov</name>
        <id>dmitri</id>
        <email>dmitri@apache.org</email>
        <organization>Plotnix, Inc</organization>
      </developer>
      <developer>
        <name>Stephen Colebourne</name>
        <id>stephen</id>
        <email>scolebourne@btopenworld.com</email>
        <organization></organization>
      </developer>
    </developers>
    
    <dependencies>
      <dependency>
        <id>junit</id>
        <type>required</type>
        <version>3.7</version>
      </dependency>
      <dependency>
        <id>ant+optional</id>
        <version>1.4.1</version>
      </dependency>
      <dependency> 
        <id>commons-lang</id> 
        <version>SNAPSHOT</version> 
      </dependency> 
      <dependency> 
        <id>commons-collections</id> 
        <type>required</type>
        <version>2.1</version> 
      </dependency> 
    </dependencies>
    
    <build>
      <unitTest>
        <includes>
          <include>**/*Test.java</include>
        </includes>
      </unitTest>
    </build>
  </project>
  
  
  
  1.8       +60 -61    jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/Clazz.java
  
  Index: Clazz.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/Clazz.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Clazz.java	7 Jan 2003 00:43:50 -0000	1.7
  +++ Clazz.java	9 Jan 2003 03:23:59 -0000	1.8
  @@ -54,17 +54,15 @@
   package org.apache.commons.clazz;
   
   import java.lang.ref.WeakReference;
  -import java.util.*;
  +import java.util.ArrayList;
  +import java.util.HashMap;
  +import java.util.Iterator;
  +import java.util.List;
  +import java.util.Map;
   
  -import org.apache.commons.clazz.bean.BeanClazzLoader;
  -import org.apache.commons.clazz.bean.BeanGroupClazzLoader;
  -import org.apache.commons.clazz.common.*;
  -import org.apache.commons.clazz.common.CachingGroupClazzLoader;
   import org.apache.commons.clazz.common.ClazzElementSupport;
  -import org.apache.commons.clazz.common.GroupClazzLoader;
  -import org.apache.commons.clazz.reflect.ReflectedGroupClazzLoader;
  -import org.apache.commons.clazz.reflect.extended.ExtendedReflectedClazzLoader;
  -import org.apache.commons.clazz.reflect.standard.StandardReflectedClazzLoader;
  +import org.apache.commons.clazz.common.ExtendedClazzLoaderFactory;
  +import org.apache.commons.clazz.common.StandardClazzLoaderFactory;
   
   /**
    * 
  @@ -79,102 +77,103 @@
       private String name;
       private List listeners;
   
  +    /**
  +     * The name of the standard clazz model. The value of the constant is
  +     * "Standard".
  +     */
       public static final String STANDARD_CLAZZ_MODEL =
  -        "org.apache.commons.clazz.StandardClazzModel";
  -        
  +        StandardClazzLoaderFactory.MODEL;
  +
  +    /**
  +     * The name of the extended clazz model. The value of the constant is
  +     * "Extended".
  +     */
       public static final String EXTENDED_CLAZZ_MODEL =
  -        "org.apache.commons.clazz.ExtendedClazzModel";
  +        ExtendedClazzLoaderFactory.MODEL;
           
  -    private static String defaultClazzModelKey = EXTENDED_CLAZZ_MODEL;
  +    private static String defaultClazzModel = EXTENDED_CLAZZ_MODEL;
       private static ClazzLoader defaultClazzLoader;
       private static Map clazzLoaderFactories = new HashMap();
       
       static {
  -        setClazzLoaderFactory(
  -            STANDARD_CLAZZ_MODEL,
  -            StandardClazzLoaderFactory.FACTORY);
  -        
  -        setClazzLoaderFactory(
  -            EXTENDED_CLAZZ_MODEL,
  -            ExtendedClazzLoaderFactory.FACTORY);
  +        addClazzLoaderFactory(StandardClazzLoaderFactory.FACTORY);
  +        addClazzLoaderFactory(ExtendedClazzLoaderFactory.FACTORY);
       }
           
       /**
  -     * Register a clazz loader factory for the specified key, which represents
  -     * the type of model the corresponding clazz loaders implement.
  +     * Register a clazz loader factory, which manages ClazzLoaders, which manage
  +     * Clazzes.
        * 
  -     * @param modelKey is the type of the model
  -     * @param clazzLoader
  +     * @param clazzLoaderFactory
        */
  -    public static void setClazzLoaderFactory(
  -            String modelKey, ClazzLoaderFactory clazzLoaderFactory)
  -    {
  -        clazzLoaderFactories.put(modelKey, clazzLoaderFactory);
  +    public static void addClazzLoaderFactory(ClazzLoaderFactory factory) {
  +        clazzLoaderFactories.put(factory.getClazzModel(), factory);
       }
       
       /**
  -     * Returns a ClazzLoaderFactory registered for the supplied model key. We
  -     * can have multiple clazz loader factories implementing different models
  -     * (e.g. Standard JavaBeans, Extended JavaBeans etc).
  +     * Returns a ClazzLoaderFactory registered for the supplied model. We can
  +     * have multiple clazz loader factories implementing different models (e.g.
  +     * Standard JavaBeans, Extended JavaBeans etc).
        * 
  -     * @param key is the type of the model we need
  +     * @param model is the type of the model we need
        * @return ClazzLoaderFactory
        */
  -    public static ClazzLoaderFactory getClazzLoaderFactory(String modelKey) {
  -        return (ClazzLoaderFactory) clazzLoaderFactories.get(modelKey);
  +    public static ClazzLoaderFactory getClazzLoaderFactory(String model) {
  +        return (ClazzLoaderFactory) clazzLoaderFactories.get(model);
       }
       
       /**
  -     * Select the default clazz model by its key.
  +     * Select the default clazz model.
        * 
  -     * @param defaultClazzModelKey
  +     * @param defaultClazzModel
        */
  -    public static void setDefaultClazzModel(String defaultClazzModelKey) {
  -        Clazz.defaultClazzModelKey = defaultClazzModelKey;
  +    public static void setDefaultClazzModel(String defaultClazzModel) {
  +        Clazz.defaultClazzModel = defaultClazzModel;
       }
   
       /**
  -     * Returns the key of the default clazz model.
  +     * Returns the name of the default clazz model.
        */
       public static String getDefaultClazzModel() {
  -        return defaultClazzModelKey;
  +        return defaultClazzModel;
       }
   
       /**
  -     * Returns a clazz loader for the specified model.  The context Class
  -     * needs to be provided in order for the ClazzLoaderFactories to be able to
  -     * determine the ClassLoader to use for reflection.
  +     * Returns a clazz loader for the specified model.  The provided ClassLoader
  +     * can be used by the ClazzLoader for reflection.
        * 
  -     * @param modelKey
  -     * @param context
  +     * @param model
  +     * @param classLoader
        * @return ClazzLoader
        */
  -    public static ClazzLoader getClazzLoader(String modelKey, Class context) {
  -        if (context == null) {
  -            context = Clazz.class;
  +    public static ClazzLoader getClazzLoader(
  +        String model,
  +        ClassLoader classLoader) 
  +    {
  +        if (classLoader == null) {
  +            classLoader = Clazz.class.getClassLoader();
           }
  -        return getClazzLoaderFactory(modelKey).getClazzLoader(
  -            context.getClassLoader());
  +        return getClazzLoaderFactory(model).getClazzLoader(classLoader);
       }
   
       /**
        * Returns the ClazzLoader for the default clazz model.
        */    
  -    public static ClazzLoader getDefaultClazzLoader(Class context) {
  -        return getClazzLoader(getDefaultClazzModel(), context);
  +    public static ClazzLoader getDefaultClazzLoader(ClassLoader classLoader) {
  +        return getClazzLoader(getDefaultClazzModel(), classLoader);
       }
       
       /**
        * Uses the clazz loader for the specified model to obtain the Clazz for the
        * supplied object.
        */
  -    public static Clazz getClazz(Object instance, String modelKey) {
  +    public static Clazz getClazz(Object instance, String model) {
           if (instance == null) {
               throw new NullPointerException();
           }
   
  -        Clazz clazz =
  -            getClazzLoader(modelKey, instance.getClass()).getClazz(instance);
  +        ClassLoader classLoader = instance.getClass().getClassLoader();
  +        Clazz clazz = getClazzLoader(model, classLoader).getClazz(instance);
           if (clazz == null) {
               throw new ClazzNotFoundException(instance.getClass().getName());
           }
  @@ -191,11 +190,11 @@
           
       /**
        * Keep the constructor protected or private, we want Clazzes to 
  -     * be created by their ClazzLoaders only.
  -     *  
     * @param loader is the owning loader
  -     * @param name must be unique within the loader
     */
  -    protected Clazz(ClazzLoader loader, String name){
  -        this.loader = loader;
  +     * be created by the ClazzLoaders only.
  +     *  
     * @param loader is the owning model clazz loader
  +     * @param name must be unique within the model
     */
  +    protected Clazz(ClazzLoader modelClazzLoader, String name){
  +        this.loader = modelClazzLoader;
           this.name = name;
       }
       
  
  
  
  1.4       +15 -17    jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/ClazzLoader.java
  
  Index: ClazzLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/ClazzLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ClazzLoader.java	14 Dec 2002 02:38:41 -0000	1.3
  +++ ClazzLoader.java	9 Jan 2003 03:23:59 -0000	1.4
  @@ -56,35 +56,33 @@
   import java.util.HashSet;
   
   /**
  - * Constructs/loads Clazzes. ClazzLoaders are accessed indirectly
  - * via ClazzLibraries.
  + * Constructs/loads Clazzes.
    * 
    * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
    * @version $Id$
 */
   public abstract class ClazzLoader
   {
  -    private ClazzLoader parent;
  +    private ModelClazzLoader modelClazzLoader;
        
       /**
  -     * ClazzLoaders are organized into hierarchies. If a lower-level ClazzLoader
  -     * cannot do a job, it delegates it to its parent.
  +     * ClazzLoaders are grouped into models.
        */
  -    public ClazzLoader(ClazzLoader parent) {
  -        this.parent = parent;
  +    public ClazzLoader(ModelClazzLoader modelClazzLoader) {
  +        this.modelClazzLoader = modelClazzLoader;
       }
  -
  -    public ClazzLoader getParentClazzLoader() {
  -        return parent;
  +    
  +    /**
  +     * Returns the model clazz loader for this clazz loader.
  +     */
  +    public ModelClazzLoader getModelClazzLoader(){
  +        return modelClazzLoader;
       }
       
       /**
  -     * Returns the ancestor that does not have a parent.
  +     * Returns the name of the model this clazz loader belongs to.
        */
  -    public ClazzLoader getRootClazzLoader(){
  -        if (parent == null){
  -            return this;
  -        }
  -        return parent.getRootClazzLoader();
  +    public String getModel(){
  +        return getModelClazzLoader().getModel();
       }
       
       /**
  
  
  
  1.3       +14 -2     jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/ClazzLoaderFactory.java
  
  Index: ClazzLoaderFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/ClazzLoaderFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ClazzLoaderFactory.java	7 Jan 2003 00:43:50 -0000	1.2
  +++ ClazzLoaderFactory.java	9 Jan 2003 03:23:59 -0000	1.3
  @@ -62,9 +62,21 @@
   public interface ClazzLoaderFactory {
   
       /**
  +     * Returns the name of the clazz model implemented by this factory.
  +     * By convention, it should be a proper identifier, no dots, capitalized.
  +     */
  +    String getClazzModel();
  +    
  +    /**
        * Allocate, configure and cache a clazz loader that uses the supplied class
        * loader for reflection.
        */
       ClazzLoader getClazzLoader(ClassLoader contextClassLoader);
  -    
  +     
  +    /**
  +     * The supplied class should be an implementation of the ClazzLoader
  +     * interface.  When ClazzLoaderFactory creates a new clazz loader, it will
  +     * instantiate all registered implementations and group them together.
  +     */
  +    void addClazzLoaderClass(Class clazzLoaderClass);
   }
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/ModelClazzLoader.java
  
  Index: ModelClazzLoader.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz;
  
  import java.util.HashMap;
  
  import org.apache.commons.clazz.common.GroupClazzLoader;
  
  /**
   * An implementation of <code>ClazzLoader</code> that functions as the top-
   * level clazz loader for a model and caches all clazzes by name.
   *
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: ModelClazzLoader.java,v 1.1 2003/01/09 03:23:59 dmitri Exp $
   */
  public class ModelClazzLoader extends GroupClazzLoader {
  
      private String model;
      private HashMap clazzMap = new HashMap();
  
      public ModelClazzLoader(String model){
          super(null);
          this.model = model;
      }
      
      public String getModel(){
          return model;
      }
      
      /**
       * @see ClazzLoader#getClazzForName(String)
       */
      public Clazz getClazzForName(String name) {
          Clazz clazz = (Clazz)clazzMap.get(name);
          if (clazz == null){
              clazz = super.getClazzForName(name);
              if (clazz != null){
                  clazzMap.put(name, clazz);
              }
          }
          return clazz;
      }
  
      /**
       * @see ClazzLoader#defineClazz(String, Class, Class)
       */
      public Clazz defineClazz(
              String name,
              Class clazzType,
              Class instanceClass) 
      {
          Clazz clazz = super.defineClazz(name, clazzType, instanceClass);
          if (clazz != null) {
              clazzMap.put(name, clazz);
          }
          return clazz;
      }
  }
  
  
  
  1.3       +9 -7      jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/bean/BeanClazzLoader.java
  
  Index: BeanClazzLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/bean/BeanClazzLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BeanClazzLoader.java	14 Dec 2002 02:38:41 -0000	1.2
  +++ BeanClazzLoader.java	9 Jan 2003 03:23:59 -0000	1.3
  @@ -57,6 +57,7 @@
   
   import org.apache.commons.clazz.Clazz;
   import org.apache.commons.clazz.ClazzLoader;
  +import org.apache.commons.clazz.ModelClazzLoader;
   
   /**
    * 
  @@ -65,12 +66,12 @@
    */
   public class BeanClazzLoader extends ClazzLoader {
       
  -    public BeanClazzLoader(ClazzLoader parent){
  -        super(parent);
  +    public BeanClazzLoader(ModelClazzLoader modelClazzLoader){
  +        super(modelClazzLoader);
       }
   
       /**
  -     * @see org.apache.commons.clazz.ClazzLoader#isMember(java.lang.Object)
  +     * @see ClazzLoader#isMember(Object)
        */
       public boolean isMember(Object instance) {
           return instance instanceof Bean;
  @@ -93,9 +94,10 @@
       }
       
       /**
  -     * @see org.apache.commons.clazz.ClazzLoader#defineClazz(java.lang.String, java.lang.Class)
  +     * @see ClazzLoader#defineClazz(String, Class, Class)
        */
  -    public Clazz defineClazz(String name, Class clazzType, Class instanceClass) {
  +    public Clazz defineClazz(String name, Class clazzType, Class instanceClass) 
  +    {
           if (!BeanClazz.class.isAssignableFrom(clazzType)) {
               return null;
           }
  @@ -107,7 +109,7 @@
                           String.class,
                           Class.class });
               return (Clazz) constructor.newInstance(
  -                new Object[] { getRootClazzLoader(), name, instanceClass });
  +                new Object[] { getModelClazzLoader(), name, instanceClass });
           }
           catch (Exception e) {
               e.printStackTrace();
  
  
  
  1.2       +6 -6      jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/bean/BeanClazzOperation.java
  
  Index: BeanClazzOperation.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/bean/BeanClazzOperation.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BeanClazzOperation.java	16 Dec 2002 23:17:41 -0000	1.1
  +++ BeanClazzOperation.java	9 Jan 2003 03:23:59 -0000	1.2
  @@ -101,7 +101,7 @@
       }
   
       /**
  -     * @see org.apache.commons.clazz.ClazzOperation#getSignature()
  +     * @see ClazzOperation#getSignature()
        */
       public String getSignature() {
           if (signature == null) {
  @@ -112,14 +112,14 @@
       }
   
       /**
  -     * @see org.apache.commons.clazz.ClazzOperation#getName()
  +     * @see ClazzOperation#getName()
        */
       public String getName() {
           return name;
       }
   
       /**
  -     * @see org.apache.commons.clazz.ClazzOperation#getParameterClazzes()
  +     * @see ClazzOperation#getParameterClazzes()
        */
       public Clazz[] getParameterClazzes() {
           if (parameterClazzes == null) {
  @@ -141,7 +141,7 @@
       }
   
       /**
  -     * @see org.apache.commons.clazz.ClazzOperation#getReturnClazz()
  +     * @see ClazzOperation#getReturnClazz()
        */
       public Clazz getReturnClazz() {
           if (returnClazzName == null){
  @@ -157,7 +157,7 @@
       }
   
       /**
  -     * @see org.apache.commons.clazz.ClazzOperation#invoke(java.lang.Object, java.lang.Object)
  +     * @see ClazzOperation#invoke(Object, Object[])
        */
       public abstract Object invoke(Object target, Object[] parameters);
   }
  
  
  
  1.3       +9 -4      jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/bean/BeanGroupClazzLoader.java
  
  Index: BeanGroupClazzLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/bean/BeanGroupClazzLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BeanGroupClazzLoader.java	14 Dec 2002 02:38:41 -0000	1.2
  +++ BeanGroupClazzLoader.java	9 Jan 2003 03:23:59 -0000	1.3
  @@ -54,6 +54,7 @@
   package org.apache.commons.clazz.bean;
   
   import org.apache.commons.clazz.ClazzLoader;
  +import org.apache.commons.clazz.ModelClazzLoader;
   import org.apache.commons.clazz.common.GroupClazzLoader;
   
   /**
  @@ -63,9 +64,13 @@
    */
   public class BeanGroupClazzLoader extends GroupClazzLoader {
   
  -    public BeanGroupClazzLoader(ClazzLoader parent){
  -        super(parent);
  +    public BeanGroupClazzLoader(ModelClazzLoader modelClazzLoader){
  +        super(modelClazzLoader);
       }
  +    
  +    public boolean canAddClazzLoader(ClazzLoader loader){
  +        return loader instanceof BeanClazzLoader;
  +    }        
   
       public boolean isMember(Object instance) {
           // This is just an optimization - the Group can answer for all
  @@ -74,7 +79,7 @@
       }
   
       /**
  -     * @see org.apache.commons.clazz.common.CachingGroupClazzLoader#getClazzName(java.lang.Object)
  +     * @see GroupClazzLoader#getClazzName(Object)
        */
       public String getClazzName(Object instance) {
           // This is just an optimization - the Group can answer for all 
  
  
  
  1.2       +89 -9     jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/common/ClazzLoaderFactorySupport.java
  
  Index: ClazzLoaderFactorySupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/common/ClazzLoaderFactorySupport.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ClazzLoaderFactorySupport.java	7 Jan 2003 00:43:50 -0000	1.1
  +++ ClazzLoaderFactorySupport.java	9 Jan 2003 03:23:59 -0000	1.2
  @@ -53,6 +53,12 @@
    */
   package org.apache.commons.clazz.common;
   
  +import java.lang.reflect.Constructor;
  +import java.util.ArrayList;
  +import java.util.List;
  +
  +import org.apache.commons.clazz.*;
  +import org.apache.commons.clazz.ClazzAccessException;
   import org.apache.commons.clazz.ClazzLoader;
   import org.apache.commons.clazz.ClazzLoaderFactory;
   import org.apache.commons.collections.ReferenceMap;
  @@ -64,6 +70,10 @@
    */
   public abstract class ClazzLoaderFactorySupport implements ClazzLoaderFactory {
   
  +    private List clazzLoaderClasses = new ArrayList();
  +    
  +    private ClazzLoader defaultClazzLoader;
  +    
       private ReferenceMap clazzLoaders =
           new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.HARD);
       
  @@ -79,14 +89,84 @@
       public synchronized ClazzLoader getClazzLoader(
               ClassLoader contextClassLoader) 
       {
  -        ClazzLoader loader = (ClazzLoader) clazzLoaders.get(contextClassLoader);
  -        if (loader == null) {
  -            loader = createClazzLoader(contextClassLoader);
  -            clazzLoaders.put(contextClassLoader, loader);
  -        }  
  -        return loader;
  +        if (contextClassLoader == null) {
  +            if (defaultClazzLoader == null) {
  +                defaultClazzLoader = createClazzLoader(null);
  +            }
  +            return defaultClazzLoader;
  +        }
  +        else {
  +            ClazzLoader loader =
  +                (ClazzLoader) clazzLoaders.get(contextClassLoader);
  +            if (loader == null) {
  +                loader = createClazzLoader(contextClassLoader);
  +                clazzLoaders.put(contextClassLoader, loader);
  +            }
  +            return loader;
  +        }
       }
  +        
  +    protected ClazzLoader createClazzLoader(
  +            ClassLoader contextClassLoader)
  +    {
  +        ModelClazzLoader modelClazzLoader =
  +            new ModelClazzLoader(getClazzModel());
  +
  +        for (int i = 0; i < clazzLoaderClasses.size(); i++) {
  +            Class javaClass = (Class) clazzLoaderClasses.get(i);
  +            ClazzLoader clazzLoader =
  +                allocateClazzLoader(
  +                    modelClazzLoader,
  +                    javaClass,
  +                    contextClassLoader);
  +            modelClazzLoader.addClazzLoader(clazzLoader);
  +        }
   
  -    protected abstract ClazzLoader createClazzLoader(
  -            ClassLoader contextClassLoader);
  +        return modelClazzLoader;
  +    }
  +  
  +    protected ClazzLoader allocateClazzLoader(
  +        ModelClazzLoader modelClazzLoader,
  +        Class javaClass,
  +        ClassLoader contextClassLoader) 
  +    {
  +        try {
  +            Constructor constructor = null;
  +            try {
  +                constructor =
  +                    javaClass.getConstructor(
  +                        new Class[] {
  +                            ModelClazzLoader.class,
  +                            ClassLoader.class });
  +            }
  +            catch (NoSuchMethodException e) {
  +            }
  +            if (constructor != null) {
  +                return (ClazzLoader) constructor.newInstance(
  +                    new Object[] { modelClazzLoader, contextClassLoader });
  +            }
  +
  +            try {
  +                constructor =
  +                    javaClass.getConstructor(
  +                        new Class[] { ModelClazzLoader.class });
  +            }
  +            catch (NoSuchMethodException e) {
  +            }
  +            if (constructor != null) {
  +                return (ClazzLoader) constructor.newInstance(
  +                    new Object[] { modelClazzLoader });
  +            }
  +            throw new IllegalArgumentException("Missing constructor");
  +        }
  +        catch (Exception e) {
  +            throw new ClazzAccessException(
  +                "Cannot allocate ClazzLoader " + javaClass.getName(),
  +                e);
  +        }
  +    }
  +    
  +    public void addClazzLoaderClass(Class clazzLoaderClass) {
  +        clazzLoaderClasses.add(clazzLoaderClass);
  +    }
   }
  
  
  
  1.3       +9 -29     jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/common/ExtendedClazzLoaderFactory.java
  
  Index: ExtendedClazzLoaderFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/common/ExtendedClazzLoaderFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExtendedClazzLoaderFactory.java	7 Jan 2003 00:43:50 -0000	1.2
  +++ ExtendedClazzLoaderFactory.java	9 Jan 2003 03:23:59 -0000	1.3
  @@ -53,7 +53,6 @@
    */
   package org.apache.commons.clazz.common;
   
  -import org.apache.commons.clazz.ClazzLoader;
   import org.apache.commons.clazz.ClazzLoaderFactory;
   import org.apache.commons.clazz.bean.BeanClazzLoader;
   import org.apache.commons.clazz.bean.BeanGroupClazzLoader;
  @@ -69,39 +68,20 @@
   
       public static final ClazzLoaderFactory FACTORY =
           new ExtendedClazzLoaderFactory();
  +        
  +    public static final String MODEL = "Extended";
   
       /**
        * Constructor for ExtendedClazzLoaderFactory.
        */
       protected ExtendedClazzLoaderFactory() {
  +        addClazzLoaderClass(ReflectedGroupClazzLoader.class);
  +        addClazzLoaderClass(BeanGroupClazzLoader.class);
  +        addClazzLoaderClass(ExtendedReflectedClazzLoader.class);
  +        addClazzLoaderClass(BeanClazzLoader.class);
       }
   
  -    public ClazzLoader createClazzLoader(ClassLoader contextClassLoader)
  -    {
  -        GroupClazzLoader loader = new CachingGroupClazzLoader(null);
  -
  -        // First build a general reflection-based ClazzLoader
  -        GroupClazzLoader reflectedGroup =
  -            new ReflectedGroupClazzLoader(loader);
  -
  -        ClazzLoader reflectedLoader =
  -            new ExtendedReflectedClazzLoader(loader, contextClassLoader);
  -
  -        reflectedGroup.addClazzLoader(reflectedLoader);
  -
  -        loader.addClazzLoader(reflectedGroup);
  -
  -        // Now build a dynamic clazz loader
  -
  -        GroupClazzLoader beanGroup = new BeanGroupClazzLoader(loader);
  -
  -        ClazzLoader beanLoader = new BeanClazzLoader(beanGroup);
  -
  -        beanGroup.addClazzLoader(beanLoader);
  -
  -        loader.addClazzLoader(beanGroup);
  -        
  -        return loader;
  +    public String getClazzModel(){
  +        return MODEL;
       }
  -
   }
  
  
  
  1.3       +42 -14    jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/common/GroupClazzLoader.java
  
  Index: GroupClazzLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/common/GroupClazzLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GroupClazzLoader.java	14 Dec 2002 02:38:41 -0000	1.2
  +++ GroupClazzLoader.java	9 Jan 2003 03:23:59 -0000	1.3
  @@ -59,19 +59,53 @@
   
   import org.apache.commons.clazz.Clazz;
   import org.apache.commons.clazz.ClazzLoader;
  +import org.apache.commons.clazz.ModelClazzLoader;
   
   /**
    * Aggregates multiple ClazzLoaders, which are invoked one after another
  - * according to the ChainOfResponsibility pattern.
  + * according to the ChainOfResponsibility pattern.  Note that member clazz
  + * loaders are invoked in the order reverse to the order they were added. 
    * 
    * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
    * @version $Id$
 */
   public class GroupClazzLoader extends ClazzLoader
   {
  -    private ArrayList loaders = new ArrayList();
  +    /**
  +     * List of member loaders. Note that the list is always iterated in the
  +     * reverse direction, so the loaded add last is the one invoked first.
  +     */
  +    protected ArrayList loaders = new ArrayList();
   
  -    public GroupClazzLoader(ClazzLoader parent){
  -        super(parent);
  +    public GroupClazzLoader(ModelClazzLoader modelClazzLoader){
  +        super(modelClazzLoader);
  +    }
  +    
  +    /**
  +     * Returns true if the supplied loader "belongs" in the group and can be
  +     * added to it.  The default implementation returns true.
  +     */
  +    public boolean canAddClazzLoader(ClazzLoader loader){
  +        return true;
  +    }
  +    
  +    /**
  +     * Adds a ClazzLoader to the group. ClazzLoaders added last are invoked
  +     * first.  Before the group adds the loader to itself, it checks if any
  +     * of its members are groups themselves and, if so, tries to add the new
  +     * loader to those subgroups.  
  +     */
  +    public void addClazzLoader(ClazzLoader loader){
  +        for (int i = loaders.size(); --i >= 0; ){
  +            ClazzLoader member = (ClazzLoader)loaders.get(i);
  +            if (member instanceof GroupClazzLoader){
  +                GroupClazzLoader group = (GroupClazzLoader)member;
  +                if (group.canAddClazzLoader(loader)){
  +                    group.addClazzLoader(loader);
  +                    return;
  +                }
  +            }
  +        }
  +        loaders.add(loader);
       }
       
       /**
  @@ -119,7 +153,7 @@
       }
       
       /**
  -     * @see org.apache.commons.clazz.ClazzLoader#defineClazz(java.lang.String, java.lang.Class)
  +     * @see ClazzLoader#defineClazz(String, Class, Class)
        */
       public Clazz defineClazz(
               String name,
  @@ -142,6 +176,7 @@
        * Adds a ClazzLoader to the group. The added clazz loader will be
        * invoked before the one supplied as the second argument.
        */
  +/*
       public void addClazzLoader(ClazzLoader loader, ClazzLoader invokeBefore){
           if (invokeBefore == null){
               addClazzLoader(loader);
  @@ -160,14 +195,7 @@
           // inserted after the parameter.
           loaders.add(index + 1, loader);
       }
  -
  -    /**
  -     * Adds a ClazzLoader to the group. ClazzLoaders added last are invoked
  -     * first.
  -     */
  -    public void addClazzLoader(ClazzLoader loader){
  -        loaders.add(loader);
  -    }
  +*/
   
       /**
        * Returns all clazz loaders registered with this group,
  
  
  
  1.3       +9 -28     jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/common/StandardClazzLoaderFactory.java
  
  Index: StandardClazzLoaderFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/common/StandardClazzLoaderFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StandardClazzLoaderFactory.java	7 Jan 2003 00:43:50 -0000	1.2
  +++ StandardClazzLoaderFactory.java	9 Jan 2003 03:23:59 -0000	1.3
  @@ -53,7 +53,6 @@
    */
   package org.apache.commons.clazz.common;
   
  -import org.apache.commons.clazz.ClazzLoader;
   import org.apache.commons.clazz.ClazzLoaderFactory;
   import org.apache.commons.clazz.bean.BeanClazzLoader;
   import org.apache.commons.clazz.bean.BeanGroupClazzLoader;
  @@ -70,37 +69,19 @@
       public static final ClazzLoaderFactory FACTORY =
           new StandardClazzLoaderFactory();
           
  +    public static final String MODEL = "Standard";
  +
       /**
        * Constructor for StandardClazzLoaderFactory.
        */
       protected StandardClazzLoaderFactory() {
  +        addClazzLoaderClass(ReflectedGroupClazzLoader.class);
  +        addClazzLoaderClass(BeanGroupClazzLoader.class);
  +        addClazzLoaderClass(StandardReflectedClazzLoader.class);
  +        addClazzLoaderClass(BeanClazzLoader.class);
       }
   
  -    public ClazzLoader createClazzLoader(ClassLoader contextClassLoader) {
  -        GroupClazzLoader loader = new CachingGroupClazzLoader(null);
  -
  -        // First build a general reflection-based ClazzLoader
  -        GroupClazzLoader reflectedGroup = new ReflectedGroupClazzLoader(loader);
  -
  -        ClazzLoader reflectedLoader =
  -            new StandardReflectedClazzLoader(loader, contextClassLoader);
  -
  -        reflectedGroup.addClazzLoader(reflectedLoader);
  -
  -        loader.addClazzLoader(reflectedGroup);
  -
  -
  -        // Now build a dynamic clazz loader
  -
  -        GroupClazzLoader beanGroup = new BeanGroupClazzLoader(loader);
  -
  -        ClazzLoader beanLoader = new BeanClazzLoader(beanGroup);
  -
  -        beanGroup.addClazzLoader(beanLoader);
  -
  -        loader.addClazzLoader(beanGroup);
  -
  -        return loader;
  +    public String getClazzModel(){
  +        return MODEL;
       }
  -
   }
  
  
  
  1.5       +81 -57    jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/ReflectedClazz.java
  
  Index: ReflectedClazz.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/ReflectedClazz.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ReflectedClazz.java	5 Jan 2003 23:11:40 -0000	1.4
  +++ ReflectedClazz.java	9 Jan 2003 03:23:59 -0000	1.5
  @@ -63,12 +63,9 @@
    * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
    * @version $Id$
    */
  -public class ReflectedClazz extends Clazz {
  +public abstract class ReflectedClazz extends Clazz {
   
       private Class instanceClass;
  -    private ReflectedPropertyIntrospector[] propertyIntrospectors;
  -    private ReflectedOperationIntrospector[] operationIntrospectors;
  -    private ReflectedInstanceFactoryIntrospector[] factoryIntrospectors;
       private boolean superClazzKnown;
       private Clazz superClazz;
       
  @@ -96,21 +93,12 @@
        * 
        * @param loader
        * @param instanceClass
  -     * @param propertyIntrospectors The order of introspectors is significant,
  -     * they are invoked sequencially. Once a property has been recoginzed by an
  -     * introspector, it will not be overridden by subsequently invoked ones.
        */
       public ReflectedClazz(
               ClazzLoader loader,
  -            Class instanceClass,
  -            ReflectedPropertyIntrospector[] propertyIntrospectors,
  -            ReflectedOperationIntrospector[] operationIntrospectors,
  -            ReflectedInstanceFactoryIntrospector[] factoryIntrospectors) 
  +            Class instanceClass) 
       {
           super(loader, getCanonicalClassName(instanceClass));
  -        this.propertyIntrospectors = propertyIntrospectors;
  -        this.operationIntrospectors = operationIntrospectors;
  -        this.factoryIntrospectors = factoryIntrospectors;
           this.instanceClass = instanceClass;
       }
       
  @@ -119,6 +107,26 @@
       }
       
       /**
  +     * The order of introspectors is significant, they are invoked sequencially.
  +     * Once a property has been recoginzed by an introspector, it will not be
  +     * overridden by subsequently invoked ones.
  +     */
  +    protected abstract ReflectedPropertyIntrospector[] 
  +            getPropertyIntrospectors();
  +
  +    /**
  +     * @see #getPropertyIntrospectors()
  +     */
  +    protected abstract ReflectedOperationIntrospector[] 
  +            getOperationIntrospectors();
  +
  +    /**
  +     * @see #getPropertyIntrospectors()
  +     */
  +    protected abstract ReflectedInstanceFactoryIntrospector[] 
  +            getInstanceFactoryIntrospectors();
  +    
  +    /**
        * Returns true if diagnostic is enabled for this clazz
     */
       public boolean isLoggingEnabled(){
           return getClazzLoader().isLoggingEnabled(getName());
  @@ -131,7 +139,7 @@
       }
       
       /**
  -     * @see org.apache.commons.clazz.Clazz#getSuperClazz()
  +     * @see Clazz#getSuperclazz()
        */
       public Clazz getSuperclazz() {
           if (!superClazzKnown){
  @@ -196,6 +204,9 @@
       public List getProperties() {
           if (propertyList == null){
               introspectProperties();
  +            if (isLoggingEnabled()) {
  +                logPropertyParseResults();
  +            }
           }
           return propertyList;
       }
  @@ -205,14 +216,14 @@
       public ClazzProperty getProperty(String name) {
           if (propertyMap == null){
               introspectProperties();
  +            if (isLoggingEnabled()) {
  +                logPropertyParseResults();
  +            }
           }
           return (ClazzProperty)propertyMap.get(name);
       }
   
       protected void addProperty(ClazzProperty property){
  -        if (property.getName().equals("ter")){
  -            new Exception().printStackTrace();
  -        }
           propertyMap.put(property.getName(), property);
           if (property instanceof ReflectedProperty){
               String[] aliases = ((ReflectedProperty)property).getAliases();
  @@ -228,6 +239,9 @@
       public List getOperations() {
           if (operationList == null){
               introspectOperations();
  +//          if (isLoggingEnabled()) {
  +//              logOperationParseResults();
  +//          }
           }
           return operationList;
       }
  @@ -238,6 +252,9 @@
       public List getDeclaredOperations() {
           if (declaredOperationList == null){
               introspectOperations();
  +//          if (isLoggingEnabled()) {
  +//              logOperationParseResults();
  +//          }
           }
           return declaredOperationList;
       }
  @@ -248,6 +265,9 @@
       public ClazzOperation getOperation(String signature) {
           if (operationMap == null){
               introspectOperations();
  +//          if (isLoggingEnabled()) {
  +//              logOperationParseResults();
  +//          }
           }
           return (ClazzOperation)operationMap.get(signature);
       }
  @@ -263,6 +283,9 @@
       public List getInstanceFactories(){
           if (factoryList == null){
               introspectInstanceFactories();
  +//          if (isLoggingEnabled()) {
  +//              logInstanceFactoryParseResults();
  +//          }
           }
           return factoryList;
       }
  @@ -278,6 +301,9 @@
       public ClazzInstanceFactory getInstanceFactory(String signature){
           if (factoryMap == null){
               introspectInstanceFactories();
  +//          if (isLoggingEnabled()) {
  +//              logInstanceFactoryParseResults();
  +//          }
           }
           if (signature == null) {
               signature = "()";
  @@ -315,20 +341,19 @@
           propertyList = new ArrayList();
           propertyMap = new HashMap();
   
  -        for (int i = 0; i < propertyIntrospectors.length; i++) {
  -            List properties =
  -                propertyIntrospectors[i].introspectProperties(
  -                    this,
  -                    instanceClass);
  -            for (int j = 0; j < properties.size(); j++) {
  -                ClazzProperty property = (ClazzProperty) properties.get(j);
  -                addProperty(property);
  +        ReflectedPropertyIntrospector introspectors[] =
  +            getPropertyIntrospectors();
  +            
  +        if (introspectors != null){
  +            for (int i = 0; i < introspectors.length; i++) {
  +                List properties =
  +                    introspectors[i].introspectProperties(this, instanceClass);
  +                for (int j = 0; j < properties.size(); j++) {
  +                    ClazzProperty property = (ClazzProperty) properties.get(j);
  +                    addProperty(property);
  +                }
               }
           }
  -
  -        if (isLoggingEnabled()) {
  -            logPropertyParseResults();
  -        }
       }
       
       /**
  @@ -350,22 +375,20 @@
               }
           }
   
  -        for (int i = 0; i < operationIntrospectors.length; i++) {
  -            List operations =
  -                operationIntrospectors[i].introspectOperations(
  -                    this,
  -                    instanceClass);
  -            for (int j = 0; j < operations.size(); j++) {
  -                ClazzOperation operation = (ClazzOperation) operations.get(j);
  -                addOperation(operation);
  +        ReflectedOperationIntrospector introspectors[] =
  +            getOperationIntrospectors();
  +
  +        if (introspectors != null){
  +            for (int i = 0; i < introspectors.length; i++) {
  +                List operations =
  +                    introspectors[i].introspectOperations(this, instanceClass);
  +                for (int j = 0; j < operations.size(); j++) {
  +                    ClazzOperation operation = (ClazzOperation) operations.get(j);
  +                    addOperation(operation);
  +                }
               }
           }
  -
           operationList.addAll(operationMap.values());
  -        
  -        //        if (isLoggingEnabled()) {
  -        //            logPropertyParseResults();
  -        //        }
       }
           
       /**
  @@ -377,21 +400,22 @@
           factoryMap = new HashMap();
           factoryList = new ArrayList();
   
  -        for (int i = 0; i < factoryIntrospectors.length; i++) {
  -            List factories =
  -                factoryIntrospectors[i].introspectInstanceFactories(
  -                    this,
  -                    instanceClass);
  -            for (int j = 0; j < factories.size(); j++) {
  -                ClazzInstanceFactory factory =
  -                    (ClazzInstanceFactory) factories.get(j);
  -                addInstanceFactory(factory);
  +        ReflectedInstanceFactoryIntrospector introspectors[] =
  +            getInstanceFactoryIntrospectors();
  +
  +        if (introspectors != null){
  +            for (int i = 0; i < introspectors.length; i++) {
  +                List factories =
  +                    introspectors[i].introspectInstanceFactories(
  +                        this,
  +                        instanceClass);
  +                for (int j = 0; j < factories.size(); j++) {
  +                    ClazzInstanceFactory factory =
  +                        (ClazzInstanceFactory) factories.get(j);
  +                    addInstanceFactory(factory);
  +                }
               }
           }
  -
  -        //        if (isLoggingEnabled()) {
  -        //            logPropertyParseResults();
  -        //        }
       }
   
       private List propertyParseResults;
  
  
  
  1.4       +99 -13    jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/ReflectedClazzLoader.java
  
  Index: ReflectedClazzLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/ReflectedClazzLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ReflectedClazzLoader.java	14 Dec 2002 02:38:41 -0000	1.3
  +++ ReflectedClazzLoader.java	9 Jan 2003 03:23:59 -0000	1.4
  @@ -53,8 +53,12 @@
    */
   package org.apache.commons.clazz.reflect;
   
  +import java.lang.reflect.Constructor;
  +
   import org.apache.commons.clazz.Clazz;
  +import org.apache.commons.clazz.ClazzAccessException;
   import org.apache.commons.clazz.ClazzLoader;
  +import org.apache.commons.clazz.ModelClazzLoader;
   
   /**
    * 
  @@ -66,10 +70,11 @@
       private ClassLoader classLoader;
       
       public ReflectedClazzLoader(
  -            ClazzLoader parent,
  +            ModelClazzLoader modelClazzLoader,
               ClassLoader classLoader) 
       {
  -        super(parent);
  +        super(modelClazzLoader);
  +        this.classLoader = classLoader;
       }
       
       public String getClazzName(Object instance) {
  @@ -79,10 +84,7 @@
           return Clazz.getCanonicalClassName(instance.getClass()); 
       }
       
  -    /**
  -     * @see org.apache.commons.clazz.ClazzLoader#getClazzForName(java.lang.String)
  -     */
  -    public Clazz getClazzForName(String name) {
  +    public Clazz getClazzForName(String name){
           Class javaClass = null;
           try {
               if (classLoader != null){
  @@ -94,6 +96,7 @@
           }
           catch (ClassNotFoundException ex){
           }
  +
           if (javaClass == null){
               try {
                   javaClass = getClazzForCanonicalName(classLoader, name);
  @@ -104,10 +107,85 @@
           if (javaClass == null){
               return null;
           }
  -        return createClazz(getRootClazzLoader(), javaClass);
  +        
  +        if (javaClass.isArray()){
  +            // TBD: automatically produce clazzes for arrays
  +        }
  +        else {
  +            Clazz clazz = lookupCustomClazz(javaClass);
  +            if (clazz != null){
  +                return clazz;
  +            }
  +        }
  +        if (!isSupportedClass(javaClass)){
  +            return null;
  +        }
  +        return createClazz(javaClass);
       }
       
       /**
  +     * Try to find and allocate a custom Clazz for the specified Java class.
  +     * Build the name of the custom Clazz class out of the name of the 
  +     * Java class, followed by the model name, followed by the word "Clazz".
  +     * For example, if the java class is called "my.Foo", and the model is
  +     * "Standard", the corresponding Clazz class name is "my.FooStandardClazz".
  +     * 
  +     * @param javaClass
  +     * @return Clazz
  +     */
  +    protected Clazz lookupCustomClazz(Class javaClass) {
  +        if (javaClass.isPrimitive()) {
  +            return null;
  +        }
  +        
  +        String customClazzName = javaClass.getName() + getModel() + "Clazz";
  +
  +        Class customClazzClass;
  +        try {
  +            if (classLoader == null){
  +                classLoader = getClass().getClassLoader();
  +            }
  +            if (classLoader != null){
  +                customClazzClass = classLoader.loadClass(customClazzName);
  +            }
  +            else {
  +                customClazzClass = Class.forName(customClazzName);
  +            }
  +        }
  +        catch (ClassNotFoundException e) {
  +            return null;
  +        }
  +            
  +        if (!Clazz.class.isAssignableFrom(customClazzClass)) {
  +            return null;
  +        }
  +        
  +        Constructor constructor;
  +        try {
  +            constructor =
  +                customClazzClass.getConstructor(
  +                    new Class[] { ClazzLoader.class, Class.class });
  +            if (constructor == null) {
  +                return null;
  +            }
  +        }
  +        catch (NoSuchMethodException e) {
  +            return null;
  +        }
  +                
  +        try {
  +            return (Clazz) constructor.newInstance(
  +                new Object[] { getModelClazzLoader(), javaClass });
  +        }
  +        catch (Exception e) {
  +            throw new ClazzAccessException(
  +                "Cannot instantiate custom ReflectedClazz " + customClazzName,
  +                e);
  +        }
  +    }
  +        
  +
  +    /**
        * Converts a canonical class name into the corresponding internal JVM type
        * name format and looks up the type.
        */
  @@ -198,9 +276,19 @@
       /**
        * Returns <code>true</code> for all objects.
        * 
  -     * @see org.apache.commons.clazz.ClazzLoader#isMember(java.lang.Object)
  +     * @see ClazzLoader#isMember(Object)
        */
       public boolean isMember(Object instance) {
  +        if (instance == null){
  +            return false;
  +        }
  +        return isSupportedClass(instance.getClass());
  +    }
  +
  +    /**
  +     * Returns true for all classes supported by this specific clazz loader.
  +     */
  +    protected boolean isSupportedClass(Class javaClass) {
           return true;
       }
   
  @@ -210,12 +298,10 @@
        * supplied clazzLoader representing the clazz loader group, not with
        * <code>this</code>.
        */
  -    protected abstract Clazz createClazz(
  -                ClazzLoader clazzLoader,
  -                Class javaClass);  
  +    protected abstract Clazz createClazz(Class javaClass);
   
       /**
  -     * @see org.apache.commons.clazz.ClazzLoader#defineClazz(java.lang.String, java.lang.Class)
  +     * @see ClazzLoader#defineClazz(String, Class, Class)
        */
       public Clazz defineClazz(
                   String name,
  
  
  
  1.3       +8 -3      jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/ReflectedGroupClazzLoader.java
  
  Index: ReflectedGroupClazzLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/ReflectedGroupClazzLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ReflectedGroupClazzLoader.java	14 Dec 2002 02:38:41 -0000	1.2
  +++ ReflectedGroupClazzLoader.java	9 Jan 2003 03:23:59 -0000	1.3
  @@ -54,6 +54,7 @@
   package org.apache.commons.clazz.reflect;
   
   import org.apache.commons.clazz.ClazzLoader;
  +import org.apache.commons.clazz.ModelClazzLoader;
   import org.apache.commons.clazz.common.GroupClazzLoader;
   
   /**
  @@ -68,8 +69,12 @@
    */
   public class ReflectedGroupClazzLoader extends GroupClazzLoader {
       
  -    public ReflectedGroupClazzLoader(ClazzLoader parent){
  -        super(parent);
  +    public ReflectedGroupClazzLoader(ModelClazzLoader modelClazzLoader){
  +        super(modelClazzLoader);
  +    }
  +
  +    public boolean canAddClazzLoader(ClazzLoader loader){
  +        return loader instanceof ReflectedClazzLoader;
       }
           
       /**
  
  
  
  1.3       +3 -3      jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/AccessorMethodParser.java
  
  Index: AccessorMethodParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/AccessorMethodParser.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AccessorMethodParser.java	14 Dec 2002 02:38:42 -0000	1.2
  +++ AccessorMethodParser.java	9 Jan 2003 03:23:59 -0000	1.3
  @@ -166,7 +166,7 @@
               }
           }
           
  -        String propertyName = parseMethodName(method);
  +        String propertyName = getPropertyName(method);
           if (propertyName == null) {
               return null;
           }
  @@ -187,7 +187,7 @@
        * method name starts with the specified prefix followed
        * by an optionally capitalized property name.
        * 
     * @param methodName
     * @return String
     */
  -    protected String parseMethodName(Method method){
  +    protected String getPropertyName(Method method){
           String name = method.getName();
           name = testAndRemoveSuffix(name);
           if (name == null){
  
  
  
  1.2       +3 -14     jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/ReflectedConstructorInstanceFactoryIntrospector.java
  
  Index: ReflectedConstructorInstanceFactoryIntrospector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/ReflectedConstructorInstanceFactoryIntrospector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReflectedConstructorInstanceFactoryIntrospector.java	14 Dec 2002 02:38:42 -0000	1.1
  +++ ReflectedConstructorInstanceFactoryIntrospector.java	9 Jan 2003 03:23:59 -0000	1.2
  @@ -67,19 +67,8 @@
    * @version $Id$
    */
   public class ReflectedConstructorInstanceFactoryIntrospector
  -    implements ReflectedInstanceFactoryIntrospector {
  -
  -    public static final 
  -        ReflectedConstructorInstanceFactoryIntrospector INTROSPECTOR =
  -            new ReflectedConstructorInstanceFactoryIntrospector();
  -
  -    /**
  -     * Singleton - not supposed to be allocated by clients. Use
  -     * the <code>INTROSPECTOR</code> static field instead.
  -     */
  -    protected ReflectedConstructorInstanceFactoryIntrospector(){
  -    }
  -
  +    implements ReflectedInstanceFactoryIntrospector 
  +{
       /**
        * @see org.apache.commons.clazz.reflect.ReflectedInstanceFactoryIntrospector#introspectInstanceFactories(org.apache.commons.clazz.reflect.ReflectedClazz, java.lang.Class)
        */
  
  
  
  1.3       +129 -154  jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/ReflectedListPropertyIntrospectorSupport.java
  
  Index: ReflectedListPropertyIntrospectorSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/ReflectedListPropertyIntrospectorSupport.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ReflectedListPropertyIntrospectorSupport.java	14 Dec 2002 02:38:42 -0000	1.2
  +++ ReflectedListPropertyIntrospectorSupport.java	9 Jan 2003 03:23:59 -0000	1.3
  @@ -68,167 +68,34 @@
   public abstract class ReflectedListPropertyIntrospectorSupport
       extends ReflectedPropertyIntrospectorSupport 
   {
  -    /**
  -     * Parser for the <code>getFooMap()</code> method:
  -     * <ul>
  -     *  <li>Return type not void</li>
  -     *  <li>Name starts with "get" followed by capitalized property name</li>
  -     *  <li>No parameters</li>
  -     * </ul>
  -     * 
  -     * We don't check if the parameter is a List here. If it is not,
  -     * we want to recognize the method and them mark the corresponding
  -     * property as NotAProperty.
  -     */
  -    protected static AccessorMethodParser READ_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  -        protected boolean testReturnType(Class returnType){
  -            return !returnType.equals(Void.TYPE);
  -        }
  -        
  -        protected String requiredPrefix(){
  -            return "get";
  -        }
  -        
  -        protected int requiredParameterCount(){
  -            return 0;
  -        }
  +    protected static final AccessorMethodParser READ_METHOD_PARSER =
  +        new ReadAccessorMethodParser();
   
  -        protected Class getValueType(Method method){
  -            return method.getReturnType();
  -        }
  -        
  -    };
  -            
  -    /**
  -     * Looks at the method to see if it has the signature
  -     * of a property read method, like "List getIntegerList()", parses it
  -     * and returns the results of parsing.  If the method signature 
  -     * does not fit the criteria, returns <code>null</code>.
  -     */
  -    protected AccessorMethodParseResults parseReadMethod(Method method) {
  -        return READ_METHOD_PARSER.parse(method);
  -    }
  +    protected static final AccessorMethodParser WRITE_METHOD_PARSER =
  +        new WriteAccessorMethodParser();
   
  -    /**
  -     * Parser for the <code>setFooList(List)</code> method:
  -     * <ul>
  -     *  <li>Return type void</li>
  -     *  <li>Name starts with "set" followed by capitalized property name</li>
  -     *  <li>One parameter</li>
  -     * </ul>
  -     * 
  -     * We don't check if the parameter is a List here. If it is not,
  -     * we want to recognize the method and them mark the corresponding
  -     * property as NotAProperty.
  -     */            
  -    protected static AccessorMethodParser WRITE_METHOD_PARSER =
  -            new AccessorMethodParser()
  -    {
  -        protected boolean testReturnType(Class returnType){
  -            return returnType.equals(Void.TYPE);
  -        }
  -        
  -        protected int requiredParameterCount(){
  -            return 1;
  -        }
  +    protected static final AccessorMethodParser GET_METHOD_PARSER =
  +        new GetAccessorMethodParser();
   
  -        protected String requiredPrefix(){
  -            return "set";
  -        }
  -                
  -        protected Class getValueType(Method method){
  -            return method.getParameterTypes()[0];
  -        }
  -    };
  +    protected static final AccessorMethodParser SET_METHOD_PARSER =
  +        new SetAccessorMethodParser();
  +
  +    protected AccessorMethodParser getReadAccessMethodParser(){
  +        return READ_METHOD_PARSER;  
  +    }
       
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parseWriteMethod(Method method) {
  -        return WRITE_METHOD_PARSER.parse(method);
  +    protected AccessorMethodParser getWriteAccessMethodParser(){
  +        return WRITE_METHOD_PARSER;  
       }
  -
  -    /**
  -     * Parser for the <code>getFoo(int)</code> method:
  -     * <ul>
  -     *  <li>Return type not void</li>
  -     *  <li>Name starts with "get" followed by capitalized singular
  -     *      form of the property name</li>
  -     *  <li>One integer parameter</li>
  -     * </ul>
  -     */            
  -    protected static AccessorMethodParser GET_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  -        protected boolean testReturnType(Class returnType){
  -            return !returnType.equals(Void.TYPE);
  -        }
  -        
  -        protected String requiredPrefix(){
  -            return "get";
  -        }
  -        
  -        protected int requiredParameterCount(){
  -            return 1;
  -        }
  -
  -        protected boolean testParameterType(int index, Class parameterType){            
  -            return parameterType.equals(Integer.TYPE);
  -        }
  -        
  -        protected Class getValueType(Method method){
  -            return method.getReturnType();
  -        }
  -    };
       
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parseGetMethod(Method method) {
  -        return GET_METHOD_PARSER.parse(method);
  +    protected AccessorMethodParser getGetAccessMethodParser(){
  +        return GET_METHOD_PARSER;  
       }
  -
  -    /**
  -     * Parser for the <code>setFoo(index, value)</code> method:
  -     * <ul>
  -     *  <li>Return type void</li>
  -     *  <li>Name starts with "set" followed by capitalized singular
  -     *      form of the property name</li>
  -     *  <li>Two parameters, first integer</li>
  -     * </ul>
  -     */                        
  -    protected static AccessorMethodParser SET_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  -        protected String requiredPrefix(){
  -            return "set";
  -        }
  -        
  -        protected int requiredParameterCount(){
  -            return 2;
  -        }
  -
  -        protected boolean testParameterType(int index, Class parameterType){
  -            if (index == 0){            
  -                return parameterType.equals(Integer.TYPE);
  -            }
  -            return true;
  -        }
  -        
  -        protected Class getValueType(Method method){
  -            return method.getParameterTypes()[1];
  -        }                
  -    };
       
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parseSetMethod(Method method) {
  -        return SET_METHOD_PARSER.parse(method);
  +    protected AccessorMethodParser getSetAccessMethodParser(){
  +        return SET_METHOD_PARSER;  
       }
  -
  +    
       /**
        * Finds a ReflectedListPropertyParseResults for the given
        * propertyName or creates a new one and puts it in the map.
  @@ -330,5 +197,113 @@
               parseResultsList.getRemoveIndexedMethod());
           property.setSizeMethod(parseResultsList.getSizeMethod());
           return property;
  -    }     
  +    }
  +    /**
  +     * Parser for the <code>getFooMap()</code> method:
  +     * <ul>
  +     *  <li>Return type not void</li>
  +     *  <li>Name starts with "get" followed by capitalized property name</li>
  +     *  <li>No parameters</li>
  +     * </ul>
  +     * 
  +     * We don't check if the parameter is a List here. If it is not,
  +     * we want to recognize the method and them mark the corresponding
  +     * property as NotAProperty.
  +     */
  +    public static class ReadAccessorMethodParser extends AccessorMethodParser {
  +        protected boolean testReturnType(Class returnType){
  +            return !returnType.equals(Void.TYPE);
  +        }
  +        protected String requiredPrefix(){
  +            return "get";
  +        }
  +        protected int requiredParameterCount(){
  +            return 0;
  +        }
  +        protected Class getValueType(Method method){
  +            return method.getReturnType();
  +        }
  +    }
  +            
  +    /**
  +     * Parser for the <code>setFooList(List)</code> method:
  +     * <ul>
  +     *  <li>Return type void</li>
  +     *  <li>Name starts with "set" followed by capitalized property name</li>
  +     *  <li>One parameter</li>
  +     * </ul>
  +     * 
  +     * We don't check if the parameter is a List here. If it is not,
  +     * we want to recognize the method and them mark the corresponding
  +     * property as NotAProperty.
  +     */      
  +    public static class WriteAccessorMethodParser extends AccessorMethodParser {
  +        protected boolean testReturnType(Class returnType){
  +            return returnType.equals(Void.TYPE);
  +        }
  +        protected int requiredParameterCount(){
  +            return 1;
  +        }
  +        protected String requiredPrefix(){
  +            return "set";
  +        }
  +        protected Class getValueType(Method method){
  +            return method.getParameterTypes()[0];
  +        }
  +    }
  +            
  +    /**
  +     * Parser for the <code>getFoo(int)</code> method:
  +     * <ul>
  +     *  <li>Return type not void</li>
  +     *  <li>Name starts with "get" followed by capitalized singular
  +     *      form of the property name</li>
  +     *  <li>One integer parameter</li>
  +     * </ul>
  +     */            
  +    public static class GetAccessorMethodParser extends AccessorMethodParser {
  +        protected boolean testReturnType(Class returnType){
  +            return !returnType.equals(Void.TYPE);
  +        }
  +        protected String requiredPrefix(){
  +            return "get";
  +        }
  +        protected int requiredParameterCount(){
  +            return 1;
  +        }
  +        protected boolean testParameterType(int index, Class parameterType){            
  +            return parameterType.equals(Integer.TYPE);
  +        }
  +        protected Class getValueType(Method method){
  +            return method.getReturnType();
  +        }
  +    }
  +             
  +    /**
  +     * Parser for the <code>setFoo(index, value)</code> method:
  +     * <ul>
  +     *  <li>Return type void</li>
  +     *  <li>Name starts with "set" followed by capitalized singular
  +     *      form of the property name</li>
  +     *  <li>Two parameters, first integer</li>
  +     * </ul>
  +     */                        
  +    public static class SetAccessorMethodParser extends AccessorMethodParser {
  +        protected String requiredPrefix(){
  +            return "set";
  +        }
  +        protected int requiredParameterCount(){
  +            return 2;
  +        }
  +        protected boolean testParameterType(int index, Class parameterType){
  +            if (index == 0){            
  +                return parameterType.equals(Integer.TYPE);
  +            }
  +            return true;
  +        }
  +        protected Class getValueType(Method method){
  +            return method.getParameterTypes()[1];
  +        }
  +    }
  +
   }
  
  
  
  1.2       +1 -12     jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/ReflectedMethodInstanceFactoryIntrospector.java
  
  Index: ReflectedMethodInstanceFactoryIntrospector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/ReflectedMethodInstanceFactoryIntrospector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReflectedMethodInstanceFactoryIntrospector.java	14 Dec 2002 02:38:42 -0000	1.1
  +++ ReflectedMethodInstanceFactoryIntrospector.java	9 Jan 2003 03:23:59 -0000	1.2
  @@ -69,16 +69,6 @@
   public class ReflectedMethodInstanceFactoryIntrospector
       implements ReflectedInstanceFactoryIntrospector {
   
  -    public static final ReflectedMethodInstanceFactoryIntrospector INTROSPECTOR =
  -        new ReflectedMethodInstanceFactoryIntrospector();
  -
  -    /**
  -     * Singleton - not supposed to be allocated by clients. Use
  -     * the <code>INTROSPECTOR</code> static field instead.
  -     */
  -    protected ReflectedMethodInstanceFactoryIntrospector() {
  -    }
  -
       /**
        * @see org.apache.commons.clazz.reflect.ReflectedInstanceFactoryIntrospector#introspectInstanceFactories(org.apache.commons.clazz.reflect.ReflectedClazz, java.lang.Class)
        */
  @@ -98,5 +88,4 @@
           }
           return list;
       }
  -
   }
  
  
  
  1.2       +2 -2      jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/ReflectedMethodOperation.java
  
  Index: ReflectedMethodOperation.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/ReflectedMethodOperation.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReflectedMethodOperation.java	14 Dec 2002 02:38:42 -0000	1.1
  +++ ReflectedMethodOperation.java	9 Jan 2003 03:23:59 -0000	1.2
  @@ -76,7 +76,7 @@
       }
   
       /**
  -     * @see org.apache.commons.clazz.ClazzOperation#invoke(java.lang.Object, java.lang.Object)
  +     * @see ClazzOperation#invoke(Object, Object[])
        */
       public Object invoke(Object target, Object[] parameters) {
           try {
  
  
  
  1.2       +1 -11     jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/ReflectedMethodOperationIntrospector.java
  
  Index: ReflectedMethodOperationIntrospector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/ReflectedMethodOperationIntrospector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReflectedMethodOperationIntrospector.java	14 Dec 2002 02:38:42 -0000	1.1
  +++ ReflectedMethodOperationIntrospector.java	9 Jan 2003 03:23:59 -0000	1.2
  @@ -71,16 +71,6 @@
   public class ReflectedMethodOperationIntrospector 
               implements ReflectedOperationIntrospector 
   {
  -    public static final ReflectedMethodOperationIntrospector INTROSPECTOR =
  -            new ReflectedMethodOperationIntrospector();
  - 
  -    /**
  -     * Singleton - not supposed to be allocated by clients. Use
  -     * the <code>INTROSPECTOR</code> static field instead.
  -     */
  -    protected ReflectedMethodOperationIntrospector(){
  -    }
  -    
       public List introspectOperations(
               ReflectedClazz clazz,
               Class javaClass)
  
  
  
  1.3       +80 -81    jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/ReflectedScalarPropertyIntrospector.java
  
  Index: ReflectedScalarPropertyIntrospector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/common/ReflectedScalarPropertyIntrospector.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ReflectedScalarPropertyIntrospector.java	14 Dec 2002 02:38:42 -0000	1.2
  +++ ReflectedScalarPropertyIntrospector.java	9 Jan 2003 03:23:59 -0000	1.3
  @@ -67,16 +67,12 @@
   public class ReflectedScalarPropertyIntrospector 
               extends ReflectedPropertyIntrospectorSupport 
   {
  -    public static final ReflectedScalarPropertyIntrospector INTROSPECTOR =
  -            new ReflectedScalarPropertyIntrospector();
  - 
  -    /**
  -     * Singleton - not supposed to be allocated by clients. Use
  -     * the <code>INTROSPECTOR</code> static field instead.
  -     */
  -    protected ReflectedScalarPropertyIntrospector(){
  -    }
  -    
  +    protected static AccessorMethodParser READ_METHOD_PARSER =
  +        new JBReadAccessorMethodParser();
  +
  +    protected static AccessorMethodParser WRITE_METHOD_PARSER =
  +        new WriteAccessorMethodParser();
  +   
       public void introspectProperties(
               ReflectedClazz clazz,
               Class javaClass,
  @@ -91,7 +87,7 @@
                   continue;
               }
               
  -            results = parseReadMethod(method);
  +            results = getReadAccessorMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -102,7 +98,7 @@
                   continue;
               }
               
  -            results = parseWriteMethod(method);
  +            results = getWriteAccessorMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -114,28 +110,90 @@
               }    
           }
       }
  + 
  +    /**
  +     * Override to return an alternative parser for the read accessor method.
  +     */
  +    protected AccessorMethodParser getReadAccessorMethodParser(){
  +        return READ_METHOD_PARSER;
  +    }
       
  +    protected AccessorMethodParser getWriteAccessorMethodParser(){
  +        return WRITE_METHOD_PARSER;
  +    }    
  +
  +    /**
  +     * Finds a ReflectedScalarPropertyParseResults for the given
  +     * propertyName or creates a new one and puts it in the map.
  +     */
  +    protected ReflectedScalarPropertyParseResults getParseResults(
  +            ReflectedClazz clazz,
  +            Map parseResultMap,
  +            String propertyName) 
  +    {
  +        ReflectedScalarPropertyParseResults parseResults =
  +            (ReflectedScalarPropertyParseResults) parseResultMap.get(
  +                propertyName);
  +        if (parseResults == null) {
  +            parseResults =
  +                new ReflectedScalarPropertyParseResults(clazz, propertyName);
  +            parseResultMap.put(propertyName, parseResults);
  +        }
  +        return parseResults;
  +    }
  +    
  +    /**
  +     * Creates a new ReflectedAccessorPairProperty based on parse results. 
     */
  +    protected ReflectedAccessorPairProperty createProperty(
  +        ReflectedClazz clazz,
  +        ReflectedPropertyParseResults parseResults)
  +    {
  +        ReflectedScalarProperty property =
  +            new ReflectedScalarProperty(clazz, parseResults.getPropertyName());
  +
  +        property.setType(parseResults.getPropertyType());
  +        property.setReadMethod(parseResults.getReadMethod());
  +        property.setWriteMethod(parseResults.getWriteMethod());
  +        return property;
  +    }
  +
       /**
        * Parser for the <code>getFoo()</code> method:
        * <ul>
        *  <li>Return type not void</li>
        *  <li>Name starts with "get" followed by capitalized property name.
  -     *      If the property is boolean the name may also start with "is".</li>
        *  <li>No parameters</li>
        * </ul>
        */
  -    protected static AccessorMethodParser READ_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  +    public static class ReadAccessorMethodParser extends AccessorMethodParser
  +    {
           protected boolean testReturnType(Class returnType){
               return !returnType.equals(Void.TYPE);
  -        }
  -        
  +        }        
           protected int requiredParameterCount(){
               return 0;
  +        }        
  +        protected String requiredPrefix(){
  +            return "get";
           }
  -        
  -        protected String parseMethodName(Method method){
  +        protected Class getValueType(Method method){
  +            return method.getReturnType();
  +        }
  +    }
  +                   
  +    /**
  +     * Parser for the <code>getFoo()</code> method:
  +     * <ul>
  +     *  <li>Return type not void</li>
  +     *  <li>Name starts with "get" followed by capitalized property name.
  +     *      If the property is boolean the name may also start with "is".</li>
  +     *  <li>No parameters</li>
  +     * </ul>
  +     */
  +    public static class JBReadAccessorMethodParser 
  +            extends ReadAccessorMethodParser
  +    {               
  +        protected String getPropertyName(Method method){
               String name = method.getName();
               String propertyName = null;
               if (name.startsWith("get")){
  @@ -159,23 +217,9 @@
               }
               return propertyName;           
           }
  -
  -        protected Class getValueType(Method method){
  -            return method.getReturnType();
  -        }
       };
               
       /**
  -     * Looks at the method to see if it has the signature
  -     * of a property read method, like "int getInteger()", parses it
  -     * and returns the results of parsing.  If the method signature 
  -     * does not fit the criteria, returns <code>null</code>.
  -     */
  -    public AccessorMethodParseResults parseReadMethod(Method method) {
  -        return READ_METHOD_PARSER.parse(method);
  -    }
  -
  -    /**
        * Parser for the <code>setFoo(value)</code> method:
        * <ul>
        *  <li>Return type void</li>
  @@ -183,64 +227,19 @@
        *  <li>One parameter</li>
        * </ul>
        */            
  -    protected static AccessorMethodParser WRITE_METHOD_PARSER =
  -            new AccessorMethodParser()
  -    {
  +    public static class WriteAccessorMethodParser extends AccessorMethodParser {
           protected int requiredParameterCount(){
               return 1;
           }
  -
           protected String requiredPrefix(){
               return "set";
           }
  -                
           protected boolean testReturnType(Class returnType){
               return returnType.equals(Void.TYPE);
           }
  -        
           protected Class getValueType(Method method){
               return method.getParameterTypes()[0];
           }
  -    };
  -
  -    /**
  -     * @see #parseReadMethod(Method)
     */
  -    public AccessorMethodParseResults parseWriteMethod(Method method) {
  -        return WRITE_METHOD_PARSER.parse(method);
       }
   
  -    /**
  -     * Finds a ReflectedScalarPropertyParseResults for the given
  -     * propertyName or creates a new one and puts it in the map.
  -     */
  -    protected ReflectedScalarPropertyParseResults getParseResults(
  -            ReflectedClazz clazz,
  -            Map parseResultMap,
  -            String propertyName) 
  -    {
  -        ReflectedScalarPropertyParseResults parseResults =
  -            (ReflectedScalarPropertyParseResults) parseResultMap.get(
  -                propertyName);
  -        if (parseResults == null) {
  -            parseResults =
  -                new ReflectedScalarPropertyParseResults(clazz, propertyName);
  -            parseResultMap.put(propertyName, parseResults);
  -        }
  -        return parseResults;
  -    }
  -    
  -    /**
  -     * Creates a new ReflectedAccessorPairProperty based on parse results. 
     */
  -    protected ReflectedAccessorPairProperty createProperty(
  -        ReflectedClazz clazz,
  -        ReflectedPropertyParseResults parseResults)
  -    {
  -        ReflectedScalarProperty property =
  -            new ReflectedScalarProperty(clazz, parseResults.getPropertyName());
  -
  -        property.setType(parseResults.getPropertyType());
  -        property.setReadMethod(parseResults.getReadMethod());
  -        property.setWriteMethod(parseResults.getWriteMethod());
  -        return property;
  -    }
   }
  
  
  
  1.3       +10 -52    jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/extended/ExtendedReflectedClazzLoader.java
  
  Index: ExtendedReflectedClazzLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/extended/ExtendedReflectedClazzLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExtendedReflectedClazzLoader.java	14 Dec 2002 02:38:42 -0000	1.2
  +++ ExtendedReflectedClazzLoader.java	9 Jan 2003 03:24:00 -0000	1.3
  @@ -54,14 +54,8 @@
   package org.apache.commons.clazz.reflect.extended;
   
   import org.apache.commons.clazz.Clazz;
  -import org.apache.commons.clazz.ClazzLoader;
  -import org.apache.commons.clazz.common.GroupClazzLoader;
  -import org.apache.commons.clazz.reflect.ReflectedClazz;
  +import org.apache.commons.clazz.ModelClazzLoader;
   import org.apache.commons.clazz.reflect.ReflectedClazzLoader;
  -import org.apache.commons.clazz.reflect.ReflectedInstanceFactoryIntrospector;
  -import org.apache.commons.clazz.reflect.ReflectedOperationIntrospector;
  -import org.apache.commons.clazz.reflect.ReflectedPropertyIntrospector;
  -import org.apache.commons.clazz.reflect.common.*;
   
   /**
    * A version of ReflectedClazzLoader that supports the extended notion of
  @@ -75,58 +69,22 @@
   public class ExtendedReflectedClazzLoader extends ReflectedClazzLoader {
   
       /**
  -     * The default list of introspectors consists of List, Mapped and Scalar
  -     * property introspectors.
  -     */
  -    private static final 
  -            ReflectedPropertyIntrospector[] DEFAULT_PROPERTY_INTROSPECTORS =
  -        new ReflectedPropertyIntrospector[] {
  -            ExtendedReflectedListPropertyIntrospector.INTROSPECTOR,
  -            ReflectedMappedPropertyIntrospector.INTROSPECTOR,
  -            ReflectedScalarPropertyIntrospector.INTROSPECTOR };
  -
  -    /**
  -     * The default list of introspectors consists just the basic method-to-
  -     * operation introspector.
  -     */
  -    private static final
  -            ReflectedOperationIntrospector[] DEFAULT_OPERATION_INTROSPECTORS =
  -        new ReflectedOperationIntrospector[] {
  -            ReflectedMethodOperationIntrospector.INTROSPECTOR
  -        };
  -        
  -    /**
  -     * The default list of introspectors consists just the basic constructor-to-
  -     * factory introspector.
  -     */
  -    private static final
  -        ReflectedInstanceFactoryIntrospector[] DEFAULT_FACTORY_INTROSPECTORS =
  -        new ReflectedInstanceFactoryIntrospector[] {
  -            ReflectedConstructorInstanceFactoryIntrospector.INTROSPECTOR,
  -            ReflectedMethodInstanceFactoryIntrospector.INTROSPECTOR
  -        };
  -
  -    /**
        * Constructor for ExtendedReflectedClazzLoader.
  -     * @param group
  +     * 
  +     * @param modelClazzLoader
        * @param classLoader
        */
       public ExtendedReflectedClazzLoader(
  -                GroupClazzLoader group,
  -                ClassLoader classLoader) 
  +            ModelClazzLoader modelClazzLoader,
  +            ClassLoader classLoader) 
       {
  -        super(group, classLoader);
  +        super(modelClazzLoader, classLoader);
       }
   
       /**
  -     * @see org.apache.commons.clazz.reflect.ReflectedClazzLoader#createClazz(org.apache.commons.clazz.ClazzLoader, java.lang.Class)
  +     * @see ReflectedClazzLoader#createClazz(Class)
        */
  -    protected Clazz createClazz(ClazzLoader clazzLoader, Class javaClass) {
  -        return new ReflectedClazz(
  -            clazzLoader,
  -            javaClass,
  -            DEFAULT_PROPERTY_INTROSPECTORS,
  -            DEFAULT_OPERATION_INTROSPECTORS,
  -            DEFAULT_FACTORY_INTROSPECTORS);
  +    protected Clazz createClazz(Class javaClass) {
  +        return new ExtendedReflectedClazz(getModelClazzLoader(), javaClass);
       }
   }
  
  
  
  1.3       +77 -105   jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/extended/ExtendedReflectedListPropertyIntrospector.java
  
  Index: ExtendedReflectedListPropertyIntrospector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/extended/ExtendedReflectedListPropertyIntrospector.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExtendedReflectedListPropertyIntrospector.java	14 Dec 2002 02:38:42 -0000	1.2
  +++ ExtendedReflectedListPropertyIntrospector.java	9 Jan 2003 03:24:00 -0000	1.3
  @@ -70,20 +70,22 @@
   public class ExtendedReflectedListPropertyIntrospector
       extends ReflectedListPropertyIntrospectorSupport 
   {
  +    protected static final AccessorMethodParser ADD_METHOD_PARSER =
  +        new AddAccessorMethodParser();
   
  -    /**
  -     * The global instance of ReflectedListPropertyIntrospectorSupport that
  -     * should be used by ReflectedClass to create list properties.
     */
  -    public static final ExtendedReflectedListPropertyIntrospector INTROSPECTOR =
  -            new ExtendedReflectedListPropertyIntrospector();
  - 
  -    /**
  -     * Singleton - not supposed to be allocated by clients. Use
  -     * the <code>INTROSPECTOR</code> static field instead.
  -     */
  -    protected ExtendedReflectedListPropertyIntrospector(){
  -    }
  -    
  +    protected static final AccessorMethodParser ADD_INDEXED_METHOD_PARSER =
  +        new AddIndexedAccessorMethodParser();
  +
  +    protected static final AccessorMethodParser REMOVE_INDEXED_METHOD_PARSER =
  +        new RemoveIndexedAccessorMethodParser();
  +
  +    protected static final AccessorMethodParser REMOVE_METHOD_PARSER =
  +        new RemoveAccessorMethodParser();
  +
  +    protected static final AccessorMethodParser SIZE_METHOD_PARSER =
  +        new SizeAccessorMethodParser();
  +                        
  +                           
       public void introspectProperties(
               ReflectedClazz clazz,
               Class javaClass,
  @@ -95,11 +97,12 @@
           AccessorMethodParseResults results;
           for (int i = 0; i < methods.length; i++) {
               Method method = methods[i];
  +            Method method3 = method;
   
               // Check getFooCount() before we check getFooList(),
               // because the parser for the latter is generic enough
               // to include the former            
  -            results = parseSizeMethod(method);
  +            results = getSizeAccessorMethodParser().parse(method3);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -110,7 +113,7 @@
                   continue;
               }
               
  -            results = parseReadMethod(method);
  +            results = getReadAccessMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -121,7 +124,7 @@
                   continue;
               }
   
  -            results = parseWriteMethod(method);
  +            results = getWriteAccessMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -132,7 +135,7 @@
                   continue;
               }
   
  -            results = parseGetMethod(method);
  +            results = getGetAccessMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -143,7 +146,7 @@
                   continue;
               }
               
  -            results = parseSetMethod(method);
  +            results = getSetAccessMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -154,7 +157,7 @@
                   continue;
               }
               
  -            results = parseAddMethod(method);
  +            results = getAddAccessorMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -164,8 +167,8 @@
                   parseResults.setAddMethodParseResults(results);
                   continue;
               }
  -            
  -            results = parseAddIndexedMethod(method);
  +
  +            results = getAddIndexedAccessorMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -175,8 +178,8 @@
                   parseResults.setAddIndexedMethodParseResults(results);
                   continue;
               }
  -            
  -            results = parseRemoveMethod(method);
  +
  +            results = getRemoveAccessorMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -187,7 +190,7 @@
                   continue;
               }
   
  -            results = parseRemoveIndexedMethod(method);
  +            results = getRemoveIndexedAccessorMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -211,6 +214,39 @@
           
           mergeSingularMethods(parseResultMap, parseResultMapSingular);
       }
  +    
  +    protected AccessorMethodParser getAddAccessorMethodParser() {
  +        return ADD_METHOD_PARSER;
  +    }
  +
  +    protected AccessorMethodParser getAddIndexedAccessorMethodParser() {
  +        return ADD_INDEXED_METHOD_PARSER;
  +    }
  +
  +    protected AccessorMethodParser getRemoveAccessorMethodParser() {
  +        return REMOVE_METHOD_PARSER;
  +    }
  +
  +    protected AccessorMethodParser getRemoveIndexedAccessorMethodParser() {
  +        return REMOVE_INDEXED_METHOD_PARSER;
  +    }
  +
  +    protected AccessorMethodParser getSizeAccessorMethodParser() {
  +        return SIZE_METHOD_PARSER;
  +    }
  +
  +    /**
  +     * Returns <code>true</code> if the suffix is "s" or 
  +     * "List", "Array" or "Vector".
  +     *  
  +     * @see ReflectedPropertyIntrospectorSupport#isCorrectPluralSuffix(String,String)
  +     */
  +    protected boolean isCorrectPluralSuffix(String singular, String suffix){
  +        return super.isCorrectPluralSuffix(singular, suffix) || 
  +                suffix.equals("List") ||
  +                suffix.equals("Array") ||
  +                suffix.equals("Vector");
  +    }
   
       /**
        * Parser for the <code>addFoo(value)</code> method:
  @@ -221,29 +257,18 @@
        *  <li>One parameter</li>
        * </ul>
        */                        
  -    protected static AccessorMethodParser ADD_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  +    public static class AddAccessorMethodParser extends AccessorMethodParser {
           protected String requiredPrefix(){
               return "add";
           }
  -        
           protected int requiredParameterCount(){
               return 1;
           }
  -
           protected Class getValueType(Method method){
               return method.getParameterTypes()[0];
  -        }        
  -    };
  -    
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parseAddMethod(Method method) {
  -        return ADD_METHOD_PARSER.parse(method);
  +        }
       }
  -
  +    
       /**
        * Parser for the <code>addFoo(index, value)</code> method:
        * <ul>
  @@ -253,36 +278,26 @@
        *  <li>Two parameters, first integer</li>
        * </ul>
        */                        
  -    protected static AccessorMethodParser ADD_INDEXED_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  +    public static class AddIndexedAccessorMethodParser 
  +        extends AccessorMethodParser 
  +    {
           protected String requiredPrefix(){
               return "add";
           }
  -        
           protected int requiredParameterCount(){
               return 2;
           }
  -
           protected boolean testParameterType(int index, Class parameterType){            
               if (index == 0){            
                   return parameterType.equals(Integer.TYPE);
               }
               return true;
           }
  -        
           protected Class getValueType(Method method){
               return method.getParameterTypes()[1];
  -        }        
  -    };
  -    
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parseAddIndexedMethod(Method method) {
  -        return ADD_INDEXED_METHOD_PARSER.parse(method);
  +        }
       }
  -
  +        
       /**
        * Parser for the <code>removeFoo(index)</code> method:
        * <ul>
  @@ -291,27 +306,18 @@
        *  <li>One integer parameter</li>
        * </ul>
        */
  -    protected static AccessorMethodParser REMOVE_INDEXED_METHOD_PARSER =
  -            new AccessorMethodParser()
  +    public static class RemoveIndexedAccessorMethodParser
  +        extends AccessorMethodParser 
       {
           protected String requiredPrefix(){
               return "remove";
           }
  -
           protected int requiredParameterCount(){
               return 1;
           }
  -
           protected boolean testParameterType(int index, Class parameterType){
               return parameterType.equals(Integer.TYPE);
           }
  -    };
  -
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parseRemoveIndexedMethod(Method method) {
  -        return REMOVE_INDEXED_METHOD_PARSER.parse(method);
       }
   
       /**
  @@ -322,33 +328,23 @@
        *  <li>One parameter</li>
        * </ul>
        */                        
  -    protected static AccessorMethodParser REMOVE_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  +    public static class RemoveAccessorMethodParser 
  +        extends AccessorMethodParser 
  +    {
           protected String requiredPrefix(){
               return "remove";
           }
  -        
           protected int requiredParameterCount(){
               return 1;
           }
  -
           protected boolean testParameterType(int index, Class parameterType){
               return !parameterType.equals(Integer.TYPE);
           }
  -        
           protected Class getValueType(Method method){
               return method.getParameterTypes()[0];
           }
  -    };
  -                        
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parseRemoveMethod(Method method) {
  -        return REMOVE_METHOD_PARSER.parse(method);
       }
  -
  +    
       /**
        * Parser for the <code>getFooCount()</code> method:
        * <ul>
  @@ -358,21 +354,16 @@
        *  <li>No parameters</li>
        * </ul>
        */                        
  -    protected static AccessorMethodParser SIZE_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  +    public static class SizeAccessorMethodParser extends AccessorMethodParser {
           protected boolean testReturnType(Class javaClass){
               return javaClass.equals(Integer.TYPE);
           }
  -        
           protected String requiredPrefix(){
               return "get";
           }
  -        
           protected int requiredParameterCount(){
               return 0;
           }
  -        
           protected String testAndRemoveSuffix(String methodName){
               if (methodName.endsWith("Count")){                
                   return methodName.substring(0, methodName.length() - 5);
  @@ -382,25 +373,6 @@
               }
               return null;
           }
  -    };
  -                        
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parseSizeMethod(Method method) {
  -        return SIZE_METHOD_PARSER.parse(method);
  -    }
  -
  -    /**
  -     * Returns <code>true</code> if the suffix is "s" or 
  -     * "List", "Array" or "Vector".
  -     *  
  -     * @see org.apache.commons.clazz.reflect.ReflectedPropertyFactorySupport#isCorrectPluralSuffix(String, String)
  -     */
  -    protected boolean isCorrectPluralSuffix(String singular, String suffix){
  -        return super.isCorrectPluralSuffix(singular, suffix) || 
  -                suffix.equals("List") ||
  -                suffix.equals("Array") ||
  -                suffix.equals("Vector");
       }
  +            
   }
  
  
  
  1.3       +171 -221  jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/extended/ReflectedMappedPropertyIntrospector.java
  
  Index: ReflectedMappedPropertyIntrospector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/extended/ReflectedMappedPropertyIntrospector.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ReflectedMappedPropertyIntrospector.java	14 Dec 2002 02:38:42 -0000	1.2
  +++ ReflectedMappedPropertyIntrospector.java	9 Jan 2003 03:24:00 -0000	1.3
  @@ -68,20 +68,24 @@
   public class ReflectedMappedPropertyIntrospector
       extends ReflectedPropertyIntrospectorSupport 
   {
  +    protected static final AccessorMethodParser READ_METHOD_PARSER =
  +        new ReadAccessorMethodParser();
   
  -    /**
  -     * The global instance of ReflectedMappedPropertyIntrospector that
  -     * should be used by ReflectedClass to create mapped properties.
     */
  -    public static final ReflectedMappedPropertyIntrospector INTROSPECTOR =
  -            new ReflectedMappedPropertyIntrospector();
  - 
  -    /**
  -     * Singleton - not supposed to be allocated by clients. Use
  -     * the <code>INTROSPECTOR</code> static field instead.
  -     */
  -    protected ReflectedMappedPropertyIntrospector(){
  -    }
  -    
  +    protected static final AccessorMethodParser WRITE_METHOD_PARSER =
  +        new WriteAccessorMethodParser();
  +
  +    protected static final AccessorMethodParser GET_METHOD_PARSER =
  +        new GetAccessorMethodParser();
  +
  +    protected static final AccessorMethodParser PUT_METHOD_PARSER =
  +        new PutAccessorMethodParser();
  +
  +    protected static final AccessorMethodParser REMOVE_METHOD_PARSER =
  +        new RemoveAccessorMethodParser();
  +
  +    protected static final AccessorMethodParser KEY_SET_METHOD_PARSER =
  +        new KeySetAccessorMethodParser();
  +                                    
       /**
        * Goes over methods of the supplied class and creates 
        * ReflectedAccessorPairProperty objects for discovered properties.
     */
  @@ -100,7 +104,7 @@
               // Check getFooKeys() before we check getFooList(),
               // because the parser for the latter is generic enough
               // to include the former            
  -            results = parseKeySetMethod(method);
  +            results = getKeySetAccessorMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -110,8 +114,8 @@
                   parseResults.setKeySetMethodParseResults(results);
                   continue;
               }
  -            
  -            results = parseReadMethod(method);
  +
  +            results = getReadAccessorMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -122,7 +126,7 @@
                   continue;
               }
   
  -            results = parseWriteMethod(method);
  +            results = getWriteAccessorMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -133,7 +137,7 @@
                   continue;
               }
   
  -            results = parseGetMethod(method);
  +            results = getGetAccessorMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -143,8 +147,8 @@
                   parseResults.setGetMethodParseResults(results);
                   continue;
               }
  -            
  -            results = parsePutMethod(method);
  +
  +            results = getPutAccessorMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -155,7 +159,7 @@
                   continue;
               }
               
  -            results = parseRemoveMethod(method);
  +            results = getRemoveAccessorMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -180,6 +184,139 @@
           mergeSingularMethods(parseResultMap, parseResultMapSingular);
       }
   
  +    protected AccessorMethodParser getReadAccessorMethodParser(){
  +        return READ_METHOD_PARSER;
  +    }
  +    
  +    protected AccessorMethodParser getWriteAccessorMethodParser(){
  +        return WRITE_METHOD_PARSER;
  +    }
  +    
  +    protected AccessorMethodParser getGetAccessorMethodParser(){
  +        return GET_METHOD_PARSER;
  +    }
  +    
  +    protected AccessorMethodParser getPutAccessorMethodParser(){
  +        return PUT_METHOD_PARSER;
  +    }
  +    
  +    protected AccessorMethodParser getRemoveAccessorMethodParser(){
  +        return REMOVE_METHOD_PARSER;
  +    }
  +    
  +    protected AccessorMethodParser getKeySetAccessorMethodParser(){
  +        return KEY_SET_METHOD_PARSER;
  +    }
  +
  +    /**
  +     * Combines data collected from singular methods like 
  +     * <code>getFoo(key)</code> with parse results for plural methods 
  +     * like <code>getFooMap()</code>. 
     */    
  +    protected void mergeSingularMethods(
  +            Map parseResultMapPlural, Map parseResultMapSingular)
  +    {
  +        Iterator iter = parseResultMapSingular.values().iterator();
  +        while (iter.hasNext()) {
  +            
  +            ReflectedMappedPropertyParseResults singular =
  +                (ReflectedMappedPropertyParseResults) iter.next();
  +                
  +            ReflectedMappedPropertyParseResults plural =
  +                findBySingularName(
  +                        parseResultMapPlural, singular.getPropertyName());
  +            
  +            if (plural != null) {
  +                plural.merge(singular);
  +            }
  +            else {
  +                // We don't have any plural methods - let's just use
  +                // the singular ones then
  +                parseResultMapPlural.put(singular.getPropertyName(), singular);
  +            }
  +        }
  +    }
  +
  +    /**
  +     * Given a singular form of a property name, locates parse results
  +     * for a property with the corresponding plural name.
     */
  +    protected ReflectedMappedPropertyParseResults findBySingularName(
  +            Map parseResultMapPlural,
  +            String singularName) 
  +    {
  +        ReflectedMappedPropertyParseResults plural =
  +            (ReflectedMappedPropertyParseResults) 
  +                parseResultMapPlural.get(singularName);
  +        if (plural != null) {
  +            return plural;
  +        }
  +
  +        Iterator iter = parseResultMapPlural.entrySet().iterator();
  +        while (iter.hasNext()) {
  +            Map.Entry entry = (Map.Entry) iter.next();
  +            if (isCorrectPluralForm(singularName, (String) entry.getKey())) {
  +                return (ReflectedMappedPropertyParseResults) entry.getValue();
  +            }
  +        }
  +        return null;
  +    }
  +
  +    /**
  +     * Returns <code>true</code> if the suffix is "s" or "Map".
  +     *  
  +     * @see ReflectedPropertyIntrospectorSupport#isCorrectPluralSuffix(String,String)
  +     */
  +    protected boolean isCorrectPluralSuffix(String singular, String suffix){
  +        return super.isCorrectPluralSuffix(singular, suffix) || 
  +                suffix.equals("Map");
  +    }
  +    
  +     
  +    /**
  +     * Finds a ReflectedMappedPropertyParseResults for the given
  +     * propertyName or creates a new one and puts it in the map.
  +     */
  +    protected ReflectedMappedPropertyParseResults getParseResults(
  +            ReflectedClazz clazz,
  +            Map parseResultMap,
  +            String propertyName) 
  +    {
  +        ReflectedMappedPropertyParseResults parseResults =
  +            (ReflectedMappedPropertyParseResults) parseResultMap.get(
  +                propertyName);
  +        if (parseResults == null) {
  +            parseResults =
  +                new ReflectedMappedPropertyParseResults(clazz, propertyName);
  +            parseResultMap.put(propertyName, parseResults);
  +        }
  +        return parseResults;
  +    }
  +    
  +    /**
  +     * Creates a new ReflectedMappedProperty based on parse results. 
  +     */
  +    protected ReflectedAccessorPairProperty createProperty(
  +        ReflectedClazz clazz,
  +        ReflectedPropertyParseResults parseResults)
  +    {
  +        ReflectedMappedProperty property =
  +            new ReflectedMappedProperty(clazz, parseResults.getPropertyName());
  +
  +        ReflectedMappedPropertyParseResults parseResultsMapped =
  +                (ReflectedMappedPropertyParseResults)parseResults;
  +
  +        property.setAliases(parseResultsMapped.getAliases());                 
  +        property.setType(parseResultsMapped.getPropertyType());
  +        property.setKeyType(parseResultsMapped.getKeyType());
  +        property.setContentType(parseResultsMapped.getContentType());
  +        property.setReadMethod(parseResultsMapped.getReadMethod());
  +        property.setWriteMethod(parseResultsMapped.getWriteMethod());
  +        property.setGetMethod(parseResultsMapped.getGetMethod());
  +        property.setPutMethod(parseResultsMapped.getPutMethod());
  +        property.setRemoveMethod(parseResultsMapped.getRemoveMethod());
  +        property.setKeySetMethod(parseResultsMapped.getKeySetMethod());
  +        return property;
  +    }
  +
       /**
        * Parser for the <code>getFooMap()</code> method:
        * <ul>
  @@ -192,37 +329,21 @@
        * we want to recognize the method and them mark the corresponding
        * property as NotAProperty.
        */
  -    protected static AccessorMethodParser READ_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  +    public static class ReadAccessorMethodParser extends AccessorMethodParser {
           protected boolean testReturnType(Class returnType){
               return !returnType.equals(Void.TYPE);
           }
  -        
           protected String requiredPrefix(){
               return "get";
           }
  -        
           protected int requiredParameterCount(){
               return 0;
           }
  -
           protected Class getValueType(Method method){
               return method.getReturnType();
           }
  -        
  -    };
  -            
  -    /**
  -     * Looks at the method to see if it has the signature
  -     * of a property read method, like "Map getIntegerMap()", parses it
  -     * and returns the results of parsing.  If the method signature 
  -     * does not fit the criteria, returns <code>null</code>.
  -     */
  -    protected AccessorMethodParseResults parseReadMethod(Method method) {
  -        return READ_METHOD_PARSER.parse(method);
       }
  -
  +    
       /**
        * Parser for the <code>setFooMap(Map)</code> method:
        * <ul>
  @@ -235,33 +356,21 @@
        * we want to recognize the method and them mark the corresponding
        * property as NotAProperty.
        */            
  -    protected static AccessorMethodParser WRITE_METHOD_PARSER =
  -            new AccessorMethodParser()
  -    {
  +    public static class WriteAccessorMethodParser extends AccessorMethodParser {
           protected boolean testReturnType(Class returnType){
               return returnType.equals(Void.TYPE);
           }
  -        
           protected int requiredParameterCount(){
               return 1;
           }
  -
           protected String requiredPrefix(){
               return "set";
           }
  -                
           protected Class getValueType(Method method){
               return method.getParameterTypes()[0];
           }
  -    };
  -    
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parseWriteMethod(Method method) {
  -        return WRITE_METHOD_PARSER.parse(method);
       }
  -
  +    
       /**
        * Parser for the <code>getFoo(key)</code> method:
        * <ul>
  @@ -271,36 +380,22 @@
        *  <li>One parameter</li>
        * </ul>
        */            
  -    protected static AccessorMethodParser GET_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  +    public static class GetAccessorMethodParser extends AccessorMethodParser {
           protected boolean testReturnType(Class returnType){
               return !returnType.equals(Void.TYPE);
           }
  -        
           protected String requiredPrefix(){
               return "get";
           }
  -        
           protected int requiredParameterCount(){
               return 1;
           }
  -
           protected Class getValueType(Method method){
               return method.getReturnType();
           }
  -        
           protected Class getParameterType(Method method){
               return method.getParameterTypes()[0];
           }
  -        
  -    };
  -    
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parseGetMethod(Method method) {
  -        return GET_METHOD_PARSER.parse(method);
       }
   
       /**
  @@ -312,34 +407,21 @@
        *  <li>Two parameters</li>
        * </ul>
        */                        
  -    protected static AccessorMethodParser PUT_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  +    public static class PutAccessorMethodParser extends AccessorMethodParser {
           protected String requiredPrefix(){
               return "set";
           }
  -        
           protected int requiredParameterCount(){
               return 2;
           }
  -
           protected Class getValueType(Method method){
               return method.getParameterTypes()[1];
           }
  -        
           protected Class getParameterType(Method method){
               return method.getParameterTypes()[0];
           }
  -        
  -    };
  -    
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parsePutMethod(Method method) {
  -        return PUT_METHOD_PARSER.parse(method);
       }
  -
  +    
       /**
        * Parser for the <code>removeFoo(key)</code> method:
        * <ul>
  @@ -348,17 +430,13 @@
        *  <li>One parameter</li>
        * </ul>
        */                        
  -    protected static AccessorMethodParser REMOVE_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  +    public static class RemoveAccessorMethodParser extends AccessorMethodParser {
           protected String requiredPrefix(){
               return "remove";
           }
  -        
           protected int requiredParameterCount(){
               return 1;
           }
  -
           protected Class getValueType(Method method){
               Class returnType = method.getReturnType();
               if (Void.TYPE.equals(returnType)){
  @@ -366,20 +444,11 @@
               }
               return returnType;
           }
  -        
           protected Class getParameterType(Method method){
               return method.getParameterTypes()[0];
           }
  -        
  -    };
  -                        
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parseRemoveMethod(Method method) {
  -        return REMOVE_METHOD_PARSER.parse(method);
       }
  -
  +    
       /**
        * Parser for the <code>getFooKeys()</code> method:
        * <ul>
  @@ -389,22 +458,19 @@
        *  <li>No parameters</li>
        * </ul>
        */                        
  -    protected static AccessorMethodParser KEY_SET_METHOD_PARSER = 
  -            new AccessorMethodParser()
  -    {               
  +    public static class KeySetAccessorMethodParser 
  +            extends AccessorMethodParser 
  +    {
           protected boolean testReturnType(Class javaClass){
               return javaClass.isArray() ||
                   Collection.class.isAssignableFrom(javaClass);
           }
  -        
           protected String requiredPrefix(){
               return "get";
           }
  -        
           protected int requiredParameterCount(){
               return 0;
           }
  -        
           protected String testAndRemoveSuffix(String methodName){
               if (methodName.endsWith("Keys")){                
                   return methodName.substring(0, methodName.length() - 4);
  @@ -414,121 +480,5 @@
               }
               return null;
           }
  -    };
  -                        
  -    /**
  -     * @see #parseReadMethod
  -     */
  -    public AccessorMethodParseResults parseKeySetMethod(Method method) {
  -        return KEY_SET_METHOD_PARSER.parse(method);
  -    }
  -
  -    /**
  -     * Combines data collected from singular methods like 
  -     * <code>getFoo(key)</code> with parse results for plural methods 
  -     * like <code>getFooMap()</code>. 
     */    
  -    protected void mergeSingularMethods(
  -            Map parseResultMapPlural, Map parseResultMapSingular)
  -    {
  -        Iterator iter = parseResultMapSingular.values().iterator();
  -        while (iter.hasNext()) {
  -            
  -            ReflectedMappedPropertyParseResults singular =
  -                (ReflectedMappedPropertyParseResults) iter.next();
  -                
  -            ReflectedMappedPropertyParseResults plural =
  -                findBySingularName(
  -                        parseResultMapPlural, singular.getPropertyName());
  -            
  -            if (plural != null) {
  -                plural.merge(singular);
  -            }
  -            else {
  -                // We don't have any plural methods - let's just use
  -                // the singular ones then
  -                parseResultMapPlural.put(singular.getPropertyName(), singular);
  -            }
  -        }
  -    }
  -
  -    /**
  -     * Given a singular form of a property name, locates parse results
  -     * for a property with the corresponding plural name.
     */
  -    protected ReflectedMappedPropertyParseResults findBySingularName(
  -            Map parseResultMapPlural,
  -            String singularName) 
  -    {
  -        ReflectedMappedPropertyParseResults plural =
  -            (ReflectedMappedPropertyParseResults) 
  -                parseResultMapPlural.get(singularName);
  -        if (plural != null) {
  -            return plural;
  -        }
  -
  -        Iterator iter = parseResultMapPlural.entrySet().iterator();
  -        while (iter.hasNext()) {
  -            Map.Entry entry = (Map.Entry) iter.next();
  -            if (isCorrectPluralForm(singularName, (String) entry.getKey())) {
  -                return (ReflectedMappedPropertyParseResults) entry.getValue();
  -            }
  -        }
  -        return null;
  -    }
  -
  -    /**
  -     * Returns <code>true</code> if the suffix is "s" or "Map".
  -     *  
  -     * @see org.apache.commons.clazz.reflect.ReflectedPropertyFactorySupport#isCorrectPluralSuffix(String, String)
  -     */
  -    protected boolean isCorrectPluralSuffix(String singular, String suffix){
  -        return super.isCorrectPluralSuffix(singular, suffix) || 
  -                suffix.equals("Map");
  -    }
  -    
  -     
  -    /**
  -     * Finds a ReflectedMappedPropertyParseResults for the given
  -     * propertyName or creates a new one and puts it in the map.
  -     */
  -    protected ReflectedMappedPropertyParseResults getParseResults(
  -            ReflectedClazz clazz,
  -            Map parseResultMap,
  -            String propertyName) 
  -    {
  -        ReflectedMappedPropertyParseResults parseResults =
  -            (ReflectedMappedPropertyParseResults) parseResultMap.get(
  -                propertyName);
  -        if (parseResults == null) {
  -            parseResults =
  -                new ReflectedMappedPropertyParseResults(clazz, propertyName);
  -            parseResultMap.put(propertyName, parseResults);
  -        }
  -        return parseResults;
  -    }
  -    
  -    /**
  -     * Creates a new ReflectedMappedProperty based on parse results. 
  -     */
  -    protected ReflectedAccessorPairProperty createProperty(
  -        ReflectedClazz clazz,
  -        ReflectedPropertyParseResults parseResults)
  -    {
  -        ReflectedMappedProperty property =
  -            new ReflectedMappedProperty(clazz, parseResults.getPropertyName());
  -
  -        ReflectedMappedPropertyParseResults parseResultsMapped =
  -                (ReflectedMappedPropertyParseResults)parseResults;
  -
  -        property.setAliases(parseResultsMapped.getAliases());                 
  -        property.setType(parseResultsMapped.getPropertyType());
  -        property.setKeyType(parseResultsMapped.getKeyType());
  -        property.setContentType(parseResultsMapped.getContentType());
  -        property.setReadMethod(parseResultsMapped.getReadMethod());
  -        property.setWriteMethod(parseResultsMapped.getWriteMethod());
  -        property.setGetMethod(parseResultsMapped.getGetMethod());
  -        property.setPutMethod(parseResultsMapped.getPutMethod());
  -        property.setRemoveMethod(parseResultsMapped.getRemoveMethod());
  -        property.setKeySetMethod(parseResultsMapped.getKeySetMethod());
  -        return property;
       }
   }
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/extended/ExtendedReflectedClazz.java
  
  Index: ExtendedReflectedClazz.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect.extended;
  
  import org.apache.commons.clazz.ClazzLoader;
  import org.apache.commons.clazz.reflect.ReflectedClazz;
  import org.apache.commons.clazz.reflect.ReflectedInstanceFactoryIntrospector;
  import org.apache.commons.clazz.reflect.ReflectedOperationIntrospector;
  import org.apache.commons.clazz.reflect.ReflectedPropertyIntrospector;
  import org.apache.commons.clazz.reflect.common.*;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: ExtendedReflectedClazz.java,v 1.1 2003/01/09 03:24:00 dmitri Exp $
   */
  public class ExtendedReflectedClazz extends ReflectedClazz {
  
      /**
       * The extended list of introspectors consists of List, Mapped and Scalar
       * property introspectors.
       */
      protected static final 
              ReflectedPropertyIntrospector[] PROPERTY_INTROSPECTORS =
          new ReflectedPropertyIntrospector[] {
              new ExtendedReflectedListPropertyIntrospector(),
              new ReflectedMappedPropertyIntrospector(),
              new ReflectedScalarPropertyIntrospector() };
  
      /**
       * The extended list of introspectors consists just the basic method-to-
       * operation introspector.
       */
      public static final
              ReflectedOperationIntrospector[] OPERATION_INTROSPECTORS =
          new ReflectedOperationIntrospector[] {
              new ReflectedMethodOperationIntrospector()
          };
          
      /**
       * The extended list of introspectors consists of the basic constructor-to-
       * factory introspector as well as an introspector that discovers static
       * methods without parameters and returning the class itself.
       */
      public static final
          ReflectedInstanceFactoryIntrospector[] INSTANCE_FACTORY_INTROSPECTORS =
          new ReflectedInstanceFactoryIntrospector[] {
              new ReflectedConstructorInstanceFactoryIntrospector(),
              new ReflectedMethodInstanceFactoryIntrospector()
          };
  
  
      /**
       * Constructor for ExtendedReflectedClazz.
       * @param loader
       * @param instanceClass
       */
      public ExtendedReflectedClazz(ClazzLoader loader, Class instanceClass) {
          super(loader, instanceClass);
      }
  
      protected ReflectedPropertyIntrospector[] getPropertyIntrospectors() {
          return PROPERTY_INTROSPECTORS;
      }
  
      protected ReflectedOperationIntrospector[] getOperationIntrospectors() {
          return OPERATION_INTROSPECTORS;
      }
  
      protected ReflectedInstanceFactoryIntrospector[] 
              getInstanceFactoryIntrospectors() 
      {
          return INSTANCE_FACTORY_INTROSPECTORS;
      }
  
  }
  
  
  
  1.3       +10 -53    jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/standard/StandardReflectedClazzLoader.java
  
  Index: StandardReflectedClazzLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/standard/StandardReflectedClazzLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StandardReflectedClazzLoader.java	14 Dec 2002 02:38:42 -0000	1.2
  +++ StandardReflectedClazzLoader.java	9 Jan 2003 03:24:00 -0000	1.3
  @@ -54,14 +54,8 @@
   package org.apache.commons.clazz.reflect.standard;
   
   import org.apache.commons.clazz.Clazz;
  -import org.apache.commons.clazz.ClazzLoader;
  -import org.apache.commons.clazz.common.GroupClazzLoader;
  -import org.apache.commons.clazz.reflect.ReflectedClazz;
  +import org.apache.commons.clazz.ModelClazzLoader;
   import org.apache.commons.clazz.reflect.ReflectedClazzLoader;
  -import org.apache.commons.clazz.reflect.ReflectedInstanceFactoryIntrospector;
  -import org.apache.commons.clazz.reflect.ReflectedOperationIntrospector;
  -import org.apache.commons.clazz.reflect.ReflectedPropertyIntrospector;
  -import org.apache.commons.clazz.reflect.common.*;
   
   /**
    * 
  @@ -69,61 +63,24 @@
    * @author Dmitri Plotnikov
    * @version $Revision$ $Date$
    */
  -public class StandardReflectedClazzLoader extends ReflectedClazzLoader {
  -
  -    /**
  -     * The default list of introspectors consists of Indexed and Scalar property
  -     * introspectors.
  -     */
  -    private static final 
  -            ReflectedPropertyIntrospector[] STANDARD_PROPERTY_INTROSPECTORS =
  -        new ReflectedPropertyIntrospector[] {
  -            StandardReflectedListPropertyIntrospector.INTROSPECTOR,
  -            ReflectedScalarPropertyIntrospector.INTROSPECTOR };
  -
  -    /**
  -     * The default list of introspectors consists just the basic method-to-
  -     * operation introspector.
  -     */
  -    private static final
  -            ReflectedOperationIntrospector[] STANDARD_OPERATION_INTROSPECTORS =
  -        new ReflectedOperationIntrospector[] {
  -            ReflectedMethodOperationIntrospector.INTROSPECTOR
  -        };
  -
  -    /**
  -     * The default list of introspectors consists just the basic constructor-to-
  -     * factory introspector.
  -     */
  -    private static final
  -        ReflectedInstanceFactoryIntrospector[] STANDARD_FACTORY_INTROSPECTORS =
  -        new ReflectedInstanceFactoryIntrospector[] {
  -            ReflectedConstructorInstanceFactoryIntrospector.INTROSPECTOR,
  -            ReflectedMethodInstanceFactoryIntrospector.INTROSPECTOR
  -        };
  -
  -
  +public class StandardReflectedClazzLoader extends ReflectedClazzLoader 
  +{
       /**
        * Constructor for StandardReflectedClazzLoader.
  -     * @param group
  +     * @param modelClazzLoader
        * @param classLoader
        */
       public StandardReflectedClazzLoader(
  -            GroupClazzLoader group,
  +            ModelClazzLoader modelClazzLoader,
               ClassLoader classLoader) 
       {
  -        super(group, classLoader);
  +        super(modelClazzLoader, classLoader);
       }
   
       /**
  -     * @see org.apache.commons.clazz.reflect.ReflectedClazzLoader#createClazz(org.apache.commons.clazz.ClazzLoader, java.lang.Class)
  +     * @see ReflectedClazzLoader#createClazz(Class)
        */
  -    protected Clazz createClazz(ClazzLoader clazzLoader, Class javaClass) {
  -        return new ReflectedClazz(
  -            clazzLoader,
  -            javaClass,
  -            STANDARD_PROPERTY_INTROSPECTORS,
  -            STANDARD_OPERATION_INTROSPECTORS,
  -            STANDARD_FACTORY_INTROSPECTORS);
  +    protected Clazz createClazz(Class javaClass) {
  +        return new StandardReflectedClazz(getModelClazzLoader(), javaClass);
       }
   }
  
  
  
  1.2       +6 -20     jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/standard/StandardReflectedListPropertyIntrospector.java
  
  Index: StandardReflectedListPropertyIntrospector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/standard/StandardReflectedListPropertyIntrospector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StandardReflectedListPropertyIntrospector.java	6 Dec 2002 01:12:50 -0000	1.1
  +++ StandardReflectedListPropertyIntrospector.java	9 Jan 2003 03:24:00 -0000	1.2
  @@ -70,20 +70,6 @@
   public class StandardReflectedListPropertyIntrospector
       extends ReflectedListPropertyIntrospectorSupport 
   {
  -
  -    /**
  -     * The global instance of ReflectedListPropertyIntrospectorSupport that
  -     * should be used by ReflectedClass to create list properties.
     */
  -    public static final StandardReflectedListPropertyIntrospector INTROSPECTOR =
  -            new StandardReflectedListPropertyIntrospector();
  - 
  -    /**
  -     * Singleton - not supposed to be allocated by clients. Use
  -     * the <code>INTROSPECTOR</code> static field instead.
  -     */
  -    protected StandardReflectedListPropertyIntrospector(){
  -    }
  -    
       public void introspectProperties(
               ReflectedClazz clazz,
               Class javaClass,
  @@ -95,8 +81,8 @@
           AccessorMethodParseResults results;
           for (int i = 0; i < methods.length; i++) {
               Method method = methods[i];
  -
  -            results = parseReadMethod(method);
  +            
  +            results = getReadAccessMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -107,7 +93,7 @@
                   continue;
               }
   
  -            results = parseWriteMethod(method);
  +            results = getWriteAccessMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -118,7 +104,7 @@
                   continue;
               }
   
  -            results = parseGetMethod(method);
  +            results = getGetAccessMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  @@ -129,7 +115,7 @@
                   continue;
               }
               
  -            results = parseSetMethod(method);
  +            results = getSetAccessMethodParser().parse(method);
               if (results != null){
                   parseResults =
                       getParseResults(
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/java/org/apache/commons/clazz/reflect/standard/StandardReflectedClazz.java
  
  Index: StandardReflectedClazz.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect.standard;
  
  import org.apache.commons.clazz.ClazzLoader;
  import org.apache.commons.clazz.reflect.ReflectedClazz;
  import org.apache.commons.clazz.reflect.ReflectedInstanceFactoryIntrospector;
  import org.apache.commons.clazz.reflect.ReflectedOperationIntrospector;
  import org.apache.commons.clazz.reflect.ReflectedPropertyIntrospector;
  import org.apache.commons.clazz.reflect.common.*;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: StandardReflectedClazz.java,v 1.1 2003/01/09 03:24:00 dmitri Exp $
   */
  public class StandardReflectedClazz extends ReflectedClazz {
  
      /**
       * The standard list of introspectors consists of Indexed and Scalar
       * property introspectors.
       */
      public static final 
              ReflectedPropertyIntrospector[] PROPERTY_INTROSPECTORS =
          new ReflectedPropertyIntrospector[] {
              new StandardReflectedListPropertyIntrospector(),
              new ReflectedScalarPropertyIntrospector() };
  
      /**
       * The standard list of introspectors consists just the basic method-to-
       * operation introspector.
       */
      public static final
              ReflectedOperationIntrospector[] OPERATION_INTROSPECTORS =
          new ReflectedOperationIntrospector[] {
              new ReflectedMethodOperationIntrospector()
          };
  
      /**
       * The standard list of introspectors consists just the basic constructor-
       * to-factory introspector.
       */
      public static final
          ReflectedInstanceFactoryIntrospector[] INSTANCE_FACTORY_INTROSPECTORS =
          new ReflectedInstanceFactoryIntrospector[] {
              new ReflectedConstructorInstanceFactoryIntrospector(),
              new ReflectedMethodInstanceFactoryIntrospector()
          };
  
      /**
       * Constructor for StandardReflectedClazz.
       */
      public StandardReflectedClazz(ClazzLoader loader, Class instanceClass) {
          super(loader, instanceClass);
      }
  
      protected ReflectedPropertyIntrospector[] getPropertyIntrospectors() {
          return PROPERTY_INTROSPECTORS;
      }
  
      protected ReflectedOperationIntrospector[] getOperationIntrospectors() {
          return OPERATION_INTROSPECTORS;
      }
  
      protected ReflectedInstanceFactoryIntrospector[] 
              getInstanceFactoryIntrospectors() 
      {
          return INSTANCE_FACTORY_INTROSPECTORS;
      }
  }
  
  
  
  1.4       +9 -6      jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/bean/BeanClazzLoaderTest.java
  
  Index: BeanClazzLoaderTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/bean/BeanClazzLoaderTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BeanClazzLoaderTest.java	7 Jan 2003 00:43:50 -0000	1.3
  +++ BeanClazzLoaderTest.java	9 Jan 2003 03:24:00 -0000	1.4
  @@ -84,10 +84,12 @@
   
       private Clazz defineClazz(){
           BeanClazz clazz =
  -            (BeanClazz) Clazz.getDefaultClazzLoader(getClass()).defineClazz(
  -                BeanClazzTest.TEST_CLAZZ_NAME,
  -                BeanClazz.class,
  -                null);
  +            (BeanClazz) Clazz
  +                .getDefaultClazzLoader(getClass().getClassLoader())
  +                .defineClazz(
  +                    BeanClazzTest.TEST_CLAZZ_NAME,
  +                    BeanClazz.class,
  +                    null);
           assertNotNull(clazz);
           ClazzProperty prop1 =
               new BeanClazzProperty(clazz, "integerProperty", "int");
  @@ -107,7 +109,8 @@
       public void testGetClazz() {
           defineClazz();
           Clazz clazz =
  -            Clazz.getDefaultClazzLoader(getClass()).getClazzForName(
  +            Clazz.getDefaultClazzLoader(
  +                getClass().getClassLoader()).getClazzForName(
                   BeanClazzTest.TEST_CLAZZ_NAME);
           assertNotNull(clazz);
       }
  
  
  
  1.5       +6 -3      jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/bean/BeanClazzTest.java
  
  Index: BeanClazzTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/bean/BeanClazzTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BeanClazzTest.java	7 Jan 2003 00:43:50 -0000	1.4
  +++ BeanClazzTest.java	9 Jan 2003 03:24:00 -0000	1.5
  @@ -60,6 +60,7 @@
   
   import org.apache.commons.clazz.Clazz;
   import org.apache.commons.clazz.ClazzInstanceFactory;
  +import org.apache.commons.clazz.ClazzLoader;
   import org.apache.commons.clazz.ClazzOperation;
   import org.apache.commons.clazz.ClazzProperty;
   import org.apache.commons.clazz.ClazzTestSupport;
  @@ -103,8 +104,10 @@
       }
   
       public void setUp(){
  +        ClazzLoader loader =
  +            Clazz.getDefaultClazzLoader(getClass().getClassLoader());
           superClazz =
  -            (BeanClazz) Clazz.getDefaultClazzLoader(getClass()).defineClazz(
  +            (BeanClazz) loader.defineClazz(
                   TEST_SUPERCLAZZ_NAME,
                   BeanClazz.class,
                   null);
  @@ -112,7 +115,7 @@
               new BeanClazzProperty(superClazz, "baseProperty"));
   
           clazz =
  -            (BeanClazz) Clazz.getDefaultClazzLoader(getClass()).defineClazz(
  +            (BeanClazz) loader.defineClazz(
                   TEST_CLAZZ_NAME,
                   BeanClazz.class,
                   null);
  
  
  
  1.6       +2 -4      jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/ReflectedClazzTestSupport.java
  
  Index: ReflectedClazzTestSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/ReflectedClazzTestSupport.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ReflectedClazzTestSupport.java	7 Jan 2003 00:43:50 -0000	1.5
  +++ ReflectedClazzTestSupport.java	9 Jan 2003 03:24:00 -0000	1.6
  @@ -90,9 +90,7 @@
        * @return ClazzLoader
        */
       protected ClazzLoader getClazzLoader(){
  -        return Clazz
  -            .getClazzLoaderFactory(getModelKey())
  -            .getClazzLoader(getClass().getClassLoader());
  +        return Clazz.getClazzLoader(getModelKey(), getClass().getClassLoader());
           
       }
   
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/ReflectedClazzTestCommon.java
  
  Index: ReflectedClazzTestCommon.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect;
  
  import java.util.List;
  
  import org.apache.commons.clazz.Clazz;
  import org.apache.commons.clazz.ClazzOperation;
  import org.apache.commons.clazz.ClazzProperty;
  import org.apache.commons.clazz.reflect.common.ReflectedScalarProperty;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: ReflectedClazzTestCommon.java,v 1.1 2003/01/09 03:24:00 dmitri Exp $
   */
  public abstract class ReflectedClazzTestCommon extends ReflectedClazzTestSupport
  {
      /**
       * Constructor for ReflectedClazzTestSupport.
       * @param name
       */
      public ReflectedClazzTestCommon(String name) {
          super(name);
      }
  
      //******************** SHARED TESTS *****************************
      
      /**
       * Checks that get/set methods are recognized properly.
       */
      public void testRecognitionOfScalarPropertyMethods(){
          ReflectedScalarProperty property =
              (ReflectedScalarProperty)clazz.getProperty("integerProperty");
  
          assertMethodSignature("Read method",
              "getIntegerProperty()",
              property.getReadMethod());
  
          assertMethodSignature("Write method",
              "setIntegerProperty(int)",
              property.getWriteMethod());
      }
  
      /**
       * Checks that the "is" method is recognized for a boolean property.
       */
      public void testRecognitionOfScalarBooleanPropertyMethods(){
          ReflectedScalarProperty property =
              (ReflectedScalarProperty)clazz.getProperty("booleanProperty");
  
          assertMethodSignature("Read method",
              "isBooleanProperty()",
              property.getReadMethod());
  
          assertMethodSignature("Write method",
              "setBooleanProperty(boolean)",
              property.getWriteMethod());
      }
  
      public void testGetOperations() {
          List list = clazz.getOperations();
          assertOperationList(
              "Operations",
              new String[] {
                  "addString(int,java.lang.String)",
                  "addString(java.lang.String)",
                  "arrays(boolean[],byte[],char[],short[],int[],long[],"
                      + "float[],double[],java.lang.Object[],java.lang.String[],"
                      + "boolean[][],java.lang.String[][])",
                  "createInstance(boolean,int)",
                  "doNothing()",
                  "equals(java.lang.Object)",
                  "getBaseProperty()",
                  "getClass()",
                  "getHalfProperty()",
                  "getIntArray()",
                  "getIntegerProperty()",
                  "getMappedBooleans()",
                  "getMappedInteger(java.lang.Integer)",
                  "getMappedIntegerKeys()",
                  "getMappedString(java.lang.String)",
                  "getMappedStringKeys()",
                  "getMappedStrings()",
                  "getNotAProperty()",
                  "getString(int)",
                  "getStringCount()",
                  "getter()",
                  "get_er()",
                  "get2er()",
                  "hashCode()",
                  "isBooleanProperty()",
                  "isNotAProperty()",
                  "notify()",
                  "notifyAll()",
                  "removeMappedInteger(java.lang.Integer)",
                  "removeMappedString(java.lang.String)",
                  "removeString(int)",
                  "removeString(java.lang.String)",
                  "resetTrace()",
                  "scalars(boolean,byte,char,short,int,long,float,double,"
                      + "java.lang.Object,java.lang.String)",
                  "setBaseProperty(java.lang.String)",
                  "setBooleanProperty(boolean)",
                  "setHalfProperty(java.lang.String)",
                  "setIntArray(int[])",
                  "setIntegerProperty(int)",
                  "setMappedBooleans(java.util.Map)",
                  "setMappedInteger(java.lang.Integer,java.lang.Integer)",
                  "setMappedString(java.lang.String,java.lang.String)",
                  "setMappedStrings(java.util.Map)",
                  "setNotAMappedProperty(java.lang.String,java.lang.String)",
                  "setNotAProperty(java.lang.String)",
                  "setString(int,java.lang.String)",
                  "toString()",
                  "toUpperCase(java.lang.String)",
                  "trace()",
                  "wait()",
                  "wait(long)",
                  "wait(long,int)",
                  },
              list);
      }
  
      public void testGetDeclaredOperations() {
          List list = clazz.getDeclaredOperations();
          assertOperationList(
              "Declared operations",
              new String[] {
                  "addString(int,java.lang.String)",
                  "addString(java.lang.String)",
                  "arrays(boolean[],byte[],char[],short[],int[],long[],float[],"
                      + "double[],java.lang.Object[],java.lang.String[],"
                      + "boolean[][],java.lang.String[][])",
                  "createInstance(boolean,int)",
                  "doNothing()",
                  "getter()",
                  "get_er()",
                  "get2er()",
                  "getHalfProperty()",
                  "getIntArray()",
                  "getIntegerProperty()",
                  "getMappedBooleans()",
                  "getMappedInteger(java.lang.Integer)",
                  "getMappedIntegerKeys()",
                  "getMappedString(java.lang.String)",
                  "getMappedStringKeys()",
                  "getMappedStrings()",
                  "getNotAProperty()",
                  "getString(int)",
                  "getStringCount()",
                  "isBooleanProperty()",
                  "isNotAProperty()",
                  "removeMappedInteger(java.lang.Integer)",
                  "removeMappedString(java.lang.String)",
                  "removeString(int)",
                  "removeString(java.lang.String)",
                  "resetTrace()",
                  "scalars(boolean,byte,char,short,int,long,float,double,"
                      + "java.lang.Object,java.lang.String)",
                  "setBooleanProperty(boolean)",
                  "setIntArray(int[])",
                  "setIntegerProperty(int)",
                  "setMappedBooleans(java.util.Map)",
                  "setMappedInteger(java.lang.Integer,java.lang.Integer)",
                  "setMappedString(java.lang.String,java.lang.String)",
                  "setMappedStrings(java.util.Map)",
                  "setNotAMappedProperty(java.lang.String,java.lang.String)",
                  "setNotAProperty(java.lang.String)",
                  "setString(int,java.lang.String)",
                  "toUpperCase(java.lang.String)",
                  "trace()",
                  },
              list);
      }
  
      public void testGetOperation() {
          String signature =
              Clazz.constructSignature(
                  "toUpperCase",
                  new Class[] { String.class });
                      
          ClazzOperation operation = clazz.getOperation(signature);
          assertNotNull(operation);
          assertEquals(
              "Operation signature",
              signature,
              operation.getSignature());
      }
  
      public void testGetInstanceFactories() {
          List list = clazz.getInstanceFactories();
          assertInstanceFactoryList(
              "Instance factories",
              new String[] {
                  "()",
                  "(int)",
                  "createInstance(boolean,int)"
                  },
              list);
      }
      
      /*
       * Test for Object newInstance()
       */
      public void testNewInstance() {
          Object object = clazz.newInstance();
          assertNotNull(object);
          assertTrue("New instance type ", object instanceof ReflectableInstance);
      }
  
      /*
       * Test for Object newInstance(Object[])
       */
      public void testNewInstanceObjectArray() {
          Object object =
              clazz.newInstance("(int)", new Object[] { new Integer(3)});
          assertNotNull(object);
          assertTrue("New instance type ", object instanceof ReflectableInstance);
          assertEquals(
              "Instance initialized",
              3,
              ((ReflectableInstance) object).getIntegerProperty());
      }
  
      /*
       * Test for Object newInstance(Object[])
       */
      public void testNewInstanceStaticMethod() {
          Object object =
              clazz.newInstance(
                  "createInstance(boolean,int)",
                  new Object[] { Boolean.TRUE, new Integer(4)});
          assertNotNull(object);
          assertTrue("New instance type ", object instanceof ReflectableInstance);
          assertEquals(
              "Instance initialized - boolean",
              true,
              ((ReflectableInstance) object).isBooleanProperty());
          assertEquals(
              "Instance initialized - integer",
              4,
              ((ReflectableInstance) object).getIntegerProperty());
      }
  
      public void testGetName() {
          assertEquals(instance.getClass().getName(), clazz.getName());
      }
  
      public void testGetPackageName() {
          String pname = ReflectableInstance.class.getName().substring(0,
                  ReflectableInstance.class.getName().lastIndexOf('.'));
          assertEquals(pname, clazz.getPackageName());
      }
  
      public void testGetShortClassName() {
          String cname = ReflectableInstance.class.getName().substring(
                  ReflectableInstance.class.getName().lastIndexOf('.') + 1);
          assertEquals(cname, clazz.getShortClassName());
      }
  
      public void testIsAssignableFrom() {
      }
  
      public void testGetScalarPropertyValue(){
          ClazzProperty property =
              (ClazzProperty) clazz.getProperty("integerProperty");
          Object result = property.get(instance);
          assertTrace(
              "getting scalar property value",
              "getIntegerProperty()");
          assertEquals(result, new Integer(0));
      }
  
      public void testPutScalarPropertyValue(){
          ClazzProperty property =
              (ClazzProperty) clazz.getProperty("integerProperty");
          property.set(instance, new Integer(3));
          assertTrace(
              "setting scalar property value",
              "setIntegerProperty()");
          assertEquals(3, instance.getIntegerProperty());
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/ReflectedInstanceFactoryTestCommon.java
  
  Index: ReflectedInstanceFactoryTestCommon.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect;
  
  import org.apache.commons.clazz.Clazz;
  import org.apache.commons.clazz.ClazzInstanceFactory;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: ReflectedInstanceFactoryTestCommon.java,v 1.1 2003/01/09 03:24:00 dmitri Exp $
   */
  public abstract class ReflectedInstanceFactoryTestCommon extends ReflectedClazzTestSupport 
  {
      protected ClazzInstanceFactory zeroParameterFactory;
      protected ClazzInstanceFactory oneParameterFactory;
      protected ClazzInstanceFactory staticMethodFactory;
  
      /**
       * Constructor for ReflectedInstanceFactoryTest.
       * @param name
       */
      public ReflectedInstanceFactoryTestCommon(String name) {
          super(name);
      }
  
      public void setUp() throws Exception {
          super.setUp();
          zeroParameterFactory =
              clazz.getInstanceFactory("()");
  
          oneParameterFactory =
              clazz.getInstanceFactory("(int)");
   
          staticMethodFactory =
              clazz.getInstanceFactory("createInstance(boolean,int)");
      }
  
      public void testGetDeclaringClazz() {
          assertTrue(
              "declaring clazz",
              zeroParameterFactory.getDeclaringClazz() == clazz);
      }
  
      public void testGetSignature() {
          assertEquals(
              "Signature",
              "()",
              zeroParameterFactory.getSignature());
          assertEquals(
              "Signature",
              "(int)",
              oneParameterFactory.getSignature());
          assertEquals(
              "Signature",
              "createInstance(boolean,int)",
              staticMethodFactory.getSignature());
      }
  
      public void testGetParameterClazzesScalar() {
          Clazz params[] = staticMethodFactory.getParameterClazzes();
          assertNotNull(params);
          assertEquals("Parameter count", 2, params.length);
          assertEquals("Param 0", "boolean", params[0].getName());
          assertEquals("Param 1", "int", params[1].getName());
      }
  
      public void testNewInstanceZeroArguments() {
          Object result =
              zeroParameterFactory.newInstance(null);
          assertNotNull(result);
          assertEquals("Clazz instance class", ReflectableInstance.class, result);
      }
  
      public void testNewInstanceOneArgument() {
          Object result =
              oneParameterFactory.newInstance(new Object[] { new Integer(3)});
          assertNotNull(result);
          assertEquals("Clazz instance class", ReflectableInstance.class, result);
          assertEquals(
              "Initialization",
              3,
              ((ReflectableInstance) result).getIntegerProperty());
      }
  
      public void testNewInstanceStaticMethod() {
          Object result =
              staticMethodFactory.newInstance(
                  new Object[] { Boolean.TRUE, new Integer(4)});
          assertNotNull(result);
          assertEquals("Clazz instance class", ReflectableInstance.class, result);
          assertEquals(
              "Initialization",
              true,
              ((ReflectableInstance) result).isBooleanProperty());
          assertEquals(
              "Initialization",
              4,
              ((ReflectableInstance) result).getIntegerProperty());
      }
  
      /*
       * Test for String toString()
       */
      public void testToString() {
      }
  
  }
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/ReflectedListPropertyTestCommon.java
  
  Index: ReflectedListPropertyTestCommon.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect;
  
  import java.util.ArrayList;
  import java.util.ConcurrentModificationException;
  import java.util.Iterator;
  import java.util.List;
  
  import org.apache.commons.clazz.reflect.common.ReflectedListProperty;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: ReflectedListPropertyTestCommon.java,v 1.1 2003/01/09 03:24:00 dmitri Exp $
   */
  public abstract class ReflectedListPropertyTestCommon 
          extends ReflectedClazzTestSupport
  {
      protected ReflectedListProperty intArrayProperty;
      protected ReflectedListProperty stringProperty;
      
      /**
       * Constructor for ReflectedPropertyMapTest.
       * @param name Is the test method name
       */
      public ReflectedListPropertyTestCommon(String name) {
          super(name);
      }
  
      public void setUp() throws Exception {
          super.setUp();
          intArrayProperty = 
              (ReflectedListProperty)clazz.getProperty("intArray");
          stringProperty = 
              (ReflectedListProperty)clazz.getProperty("string");
      }
  
      public void testSizeWithArray(){
          populateIntArray();
  
          List list = (List)intArrayProperty.get(instance);
          int count = list.size();
  
          assertTrace(
              "getting size with count getter",
              "getIntArray()");
          assertEquals(3, count);
      }
  
      public void testSizeWithEmpty() {
          List list = (List)intArrayProperty.get(instance);
          int count = list.size();
          
          assertTrace("getting size", "getIntArray()");
          assertEquals(0, count);
      }
  
      public void testIsEmptyWithArray() {
          List list = (List)intArrayProperty.get(instance);
          boolean empty = list.isEmpty();
          assertTrace("empty", "getIntArray()");
          assertTrue(empty);
  
          populateIntArray();        
  //        list = (List)intArrayProperty.get(instance);
          empty = list.isEmpty();
          assertTrace("not empty", "getIntArray()");
          assertTrue(!empty);
      }
  
      public void testContainsWithArraySuccess() {
          populateIntArray();
          
          List list = (List)intArrayProperty.get(instance);
          boolean contains = list.contains(new Integer(2));
          assertTrace("contains", "getIntArray()");
          assertTrue(contains);
      }
      
      public void testContainsWithArrayFailure() {
          populateIntArray();
  
          List list = (List)intArrayProperty.get(instance);
          boolean contains = list.contains(new Integer(371));
          assertTrace("does not contain", "getIntArray()");
          assertTrue(!contains);
      }
  
      public void testIteratorWithArray() {
          populateIntArray();
          
          List list = (List)intArrayProperty.get(instance);
          Iterator it = list.iterator();
          ArrayList result = new ArrayList();
          while (it.hasNext()){
              result.add(it.next());
          }        
          
          assertTrace("iterator", "getIntArray()");
          
          ArrayList expected = new ArrayList();
          expected.add(new Integer(1));
          expected.add(new Integer(2));
          expected.add(new Integer(3));
          
          assertEquals("iterator", expected, result);
      }
  
      /*
       * Test for Object[] toArray()
       */
      public void testToArray() {
      }
  
      /*
       * Test for Object[] toArray(Object[])
       */
      public void testToArrayObjectArray() {
      }
  
      /*
       * Test for boolean add(Object)
       */
      public void testAddObjectWithArrayStartEmpty() {
          List list = (List)intArrayProperty.get(instance);
          list.add(new Integer(1));
  
          assertTrace("add", "getIntArray()", "setIntArray(int[])");
  
          ArrayList expected = new ArrayList();
          expected.add(new Integer(1));
          assertEquals("result of add via list", expected, list);
          
          int array[] = instance.getIntArray();        
          assertEquals("result of add directly (length)", 1, array.length);
          assertEquals("result of add directly (value)", 1, array[0]);
      }
  
      /*
       * Test for boolean add(Object)
       */
      public void testAddObjectWithArrayStartPopulated() {
          populateIntArray();
          
          List list = (List)intArrayProperty.get(instance);
          list.add(new Integer(4));
  
          assertTrace("add", "getIntArray()", "setIntArray(int[])");
  
  //        System.err.println("LIST: " + list);
          ArrayList expected = new ArrayList();
          expected.add(new Integer(1));
          expected.add(new Integer(2));
          expected.add(new Integer(3));
          expected.add(new Integer(4));
          assertEquals("result of add via list", expected, list);
  
          int array[] = instance.getIntArray();
          assertEquals("result of add directly (length)", 4, array.length);
          assertEquals("result of add directly (value)", 4, array[3]);
      }
      
      /*
       * Test for boolean add(Object)
       */
      public void testConcurrentModificationException() {
          populateIntArray();
  
          boolean ex = false;
          List list = (List)intArrayProperty.get(instance);
          Iterator it = list.iterator();
          it.next();
          list.add(new Integer(4));
          try {
              it.next();
          }
          catch (ConcurrentModificationException e){
              ex = true;
          }
          
          assertTrue("concurrent mod exception", ex);
      }
  
      /*
       * Test for boolean remove(Object)
       */
      public void testRemoveObjectFromArray() {
          populateIntArray();
  
          List list = (List)intArrayProperty.get(instance);
          list.remove(new Integer(2));
  
          assertTrace(
              "remove",
              new String[] {
                  "getIntArray()",            // For iteration
                  "getIntArray()",            // For removal
                  "setIntArray(int[])" });    // New shorter array
          
          ArrayList expected = new ArrayList();
          expected.add(new Integer(1));
          expected.add(new Integer(3));
          assertEquals("result of remove via list", expected, list);
  
          int array[] = instance.getIntArray();
          assertEquals("result of remove directly (length)", 2, array.length);
      }
  
      /*
       * Test for Object remove(int)
       */
      public void testRemoveWithIndexFromArray() {
          populateIntArray();
  
          List list = (List)intArrayProperty.get(instance);
          list.remove(1);
  
          assertTrace("remove", "getIntArray()", "setIntArray(int[])");
  
          ArrayList expected = new ArrayList();
          expected.add(new Integer(1));
          expected.add(new Integer(3));
          assertEquals("result of remove via list", expected, list);
  
          int array[] = instance.getIntArray();
          assertEquals("result of remove directly (length)", 2, array.length);
      }
      
      public void testContainsAll() {
      }
  
      /*
       * Test for boolean addAll(Collection)
       */
      public void testAddAllCollection() {
      }
  
      /*
       * Test for boolean addAll(int, Collection)
       */
      public void testAddAllICollection() {
      }
  
      public void testRemoveAll() {
      }
  
      public void testRetainAll() {
      }
  
      public void testClear() {
      }
  
      public void testGetWithArray() {
          populateIntArray();
                  
          List list = (List)intArrayProperty.get(instance);
          Object value = list.get(1);
          
          assertTrace(
              "getting value with direct getter",
              "getIntArray()");
          assertEquals(new Integer(2), value);
      }
  
      public void testGetWithList() {
          populateStringList();
          
          List list = (List)stringProperty.get(instance);
          Object value = list.get(1);
          
          assertTrace(
              "getting value with parameterized getter",
              "getString(int)");
              
          assertEquals("bar", value);
      }
  
      public void testSetWithArray() {
          populateIntArray();
          
          List list = (List)intArrayProperty.get(instance);
          list.set(1, new Integer(7));
          
          assertTrace(
              "setting value with direct getter",
              "getIntArray()");
          assertEquals(7, instance.getIntArray()[1]);
      }
      
      public void testSetWithList() {
          populateStringList();
          
          List list = (List)stringProperty.get(instance);
          list.set(1, "biz");
          
          assertTrace(
              "setting value with parameterized setter",
              "getString(int)",
              "setString(int,String)");
              
          assertEquals("biz", instance.getString(1));
      }
  
      public void testIndexOf() {
      }
  
      public void testLastIndexOf() {
      }
  
      /*
       * Test for ListIterator listIterator()
       */
      public void testListIterator() {
      }
  
      /*
       * Test for ListIterator listIterator(int)
       */
      public void testListIteratorI() {
      }
  
      public void testSubList() {
      }
      
      /**
       * We are supposed to get different results for standard and extended models
       * when the corresponding property does not have a <code>get</code> method
       * that returns the whole list. The extended model can still take care of
       * this as long as there is a <code>get<i>Foo</i>Count()</code> method.
       */
      public abstract void testSizeWithList();
      public abstract void testIsEmptyWithList();    
      public abstract void testContainsWithListSuccess();
      public abstract void testContainsWithListFailure();
      public abstract void testIteratorWithList();
      public abstract void testAddObjectWithListStartEmpty();
      public abstract void testAddObjectWithListStartPopulated();
      public abstract void testAddIndexedWithList();
  
      public void populateIntArray() {
          instance.setIntArray(new int[]{1, 2, 3});
          instance.resetTrace();
      }
  
      public void populateStringList() {
          instance.addString("foo");
          instance.addString("bar");
          instance.addString("baz");
          instance.resetTrace();
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/ReflectedOperationCommon.java
  
  Index: ReflectedOperationCommon.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect;
  
  import org.apache.commons.clazz.Clazz;
  import org.apache.commons.clazz.ClazzOperation;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: ReflectedOperationCommon.java,v 1.1 2003/01/09 03:24:00 dmitri Exp $
   */
  public abstract class ReflectedOperationCommon extends ReflectedClazzTestSupport 
  {
      protected ClazzOperation voidOperationWithoutParameters;
      protected ClazzOperation stringOperationWithParameters;
      protected ClazzOperation operationWithScalarParameters;
      protected ClazzOperation operationWithArrayParameters;
      
      /**
       * Constructor for ReflectedOperationTest.
       * @param name
       */
      public ReflectedOperationCommon(String name) {
          super(name);
      }
      
      public void setUp() throws Exception {
          super.setUp();
          voidOperationWithoutParameters =
              clazz.getOperation("doNothing()");
              
          stringOperationWithParameters =
              clazz.getOperation("toUpperCase(java.lang.String)");
              
          operationWithScalarParameters =
              clazz.getOperation(
                  "scalars("
                      + "boolean,byte,char,short,int,long,float,double,"
                      + "java.lang.Object,java.lang.String)");
                      
          operationWithArrayParameters =
              clazz.getOperation(
                  "arrays("
                      + "boolean[],byte[],char[],short[],"
                      + "int[],long[],float[],double[],"
                      + "java.lang.Object[],java.lang.String[],"
                      + "boolean[][],java.lang.String[][])");
      }
  
      public void testGetDeclaringClazz() {
          assertTrue(
              "declaring clazz",
              stringOperationWithParameters.getDeclaringClazz() == clazz);
      }
  
      public void testGetSignature() {
          assertEquals(
              "Signature",
              "toUpperCase(java.lang.String)",
              stringOperationWithParameters.getSignature());
      }
  
      public void testGetParameterClazzesScalar() {
          Clazz params[] = operationWithScalarParameters.getParameterClazzes();
          assertNotNull(params);
          assertEquals("Parameter count", 10, params.length);
          assertEquals("Param 0", "boolean", params[0].getName());
          assertEquals("Param 1", "byte", params[1].getName());
          assertEquals("Param 2", "char", params[2].getName());
          assertEquals("Param 3", "short", params[3].getName());
          assertEquals("Param 4", "int", params[4].getName());
          assertEquals("Param 5", "long", params[5].getName());
          assertEquals("Param 6", "float", params[6].getName());
          assertEquals("Param 7", "double", params[7].getName());
          assertEquals("Param 8", "java.lang.Object", params[8].getName());
          assertEquals("Param 9", "java.lang.String", params[9].getName());
      }
  
      public void testGetParameterClazzesArrays() {
          Clazz params[] = operationWithArrayParameters.getParameterClazzes();
          assertNotNull(params);
          assertEquals("Parameter count", 12, params.length);
          assertEquals("Param 0", "boolean[]", params[0].getName());
          assertEquals("Param 1", "byte[]", params[1].getName());
          assertEquals("Param 2", "char[]", params[2].getName());
          assertEquals("Param 3", "short[]", params[3].getName());
          assertEquals("Param 4", "int[]", params[4].getName());
          assertEquals("Param 5", "long[]", params[5].getName());
          assertEquals("Param 6", "float[]", params[6].getName());
          assertEquals("Param 7", "double[]", params[7].getName());
          assertEquals("Param 8", "java.lang.Object[]", params[8].getName());
          assertEquals("Param 9", "java.lang.String[]", params[9].getName());
          assertEquals("Param 10", "boolean[][]", params[10].getName());
          assertEquals("Param 11", "java.lang.String[][]", params[11].getName());
      }
  
      public void testGetReturnClazz() {
          Clazz returnClazz = stringOperationWithParameters.getReturnClazz();
          assertNotNull(returnClazz);
          assertEquals("Return clazz", "java.lang.String", returnClazz.getName()); 
      }
  
      public void testInvokeWithStringResult() {
          Object result =
              stringOperationWithParameters.invoke(
                  new ReflectableInstance(),
                  new Object[] { "foo" });
          assertNotNull(result);
          assertEquals("Return type", String.class, result.getClass());
          assertEquals("Return value", "FOO", result);
      }
  
      public void testInvokeWithVoidResult() {
          Object result =
              voidOperationWithoutParameters.invoke(
                  new ReflectableInstance(),
                  null);
          assertNull(result);
      }
      
      /*
       * Test for String toString()
       */
      public void testToString() {
      }
  
  }
  
  
  
  1.5       +5 -4      jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/ExtendedReflectedClazzTest.java
  
  Index: ExtendedReflectedClazzTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/ExtendedReflectedClazzTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ExtendedReflectedClazzTest.java	7 Jan 2003 00:43:50 -0000	1.4
  +++ ExtendedReflectedClazzTest.java	9 Jan 2003 03:24:01 -0000	1.5
  @@ -56,16 +56,15 @@
   import junit.framework.TestSuite;
   
   import org.apache.commons.clazz.Clazz;
  -import org.apache.commons.clazz.ClazzLoader;
   import org.apache.commons.clazz.reflect.ReflectableInstance;
  -import org.apache.commons.clazz.reflect.ReflectedClazzTest;
  +import org.apache.commons.clazz.reflect.ReflectedClazzTestCommon;
   
   /**
    * 
    * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
    * @version $Id$
    */
  -public class ExtendedReflectedClazzTest extends ReflectedClazzTest {
  +public class ExtendedReflectedClazzTest extends ReflectedClazzTestCommon {
   
       /**
        * Constructor for ReflectedClazzTest.
  @@ -86,6 +85,8 @@
           suite.addTestSuite(ReflectedMappedPropertyTest.class);
           suite.addTestSuite(ExtendedReflectedOperationTest.class);
           suite.addTestSuite(ExtendedReflectedInstanceFactoryTest.class);
  +        suite.addTestSuite(CustomBean1ExtendedClazzTest.class);
  +        suite.addTestSuite(CustomClazzLoaderTest.class);
           return suite;
       }
   
  
  
  
  1.4       +3 -4      jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/ExtendedReflectedInstanceFactoryTest.java
  
  Index: ExtendedReflectedInstanceFactoryTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/ExtendedReflectedInstanceFactoryTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ExtendedReflectedInstanceFactoryTest.java	7 Jan 2003 00:43:51 -0000	1.3
  +++ ExtendedReflectedInstanceFactoryTest.java	9 Jan 2003 03:24:01 -0000	1.4
  @@ -54,15 +54,14 @@
   package org.apache.commons.clazz.reflect.extended;
   
   import org.apache.commons.clazz.Clazz;
  -import org.apache.commons.clazz.ClazzLoader;
  -import org.apache.commons.clazz.reflect.ReflectedOperationTest;
  +import org.apache.commons.clazz.reflect.ReflectedOperationCommon;
   
   /**
    * 
    * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
    * @version $Id$
    */
  -public class ExtendedReflectedInstanceFactoryTest extends ReflectedOperationTest {
  +public class ExtendedReflectedInstanceFactoryTest extends ReflectedOperationCommon {
   
       /**
        * Constructor for ExtendedReflectedOperationTest.
  
  
  
  1.5       +3 -4      jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/ExtendedReflectedListPropertyTest.java
  
  Index: ExtendedReflectedListPropertyTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/ExtendedReflectedListPropertyTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ExtendedReflectedListPropertyTest.java	7 Jan 2003 00:43:51 -0000	1.4
  +++ ExtendedReflectedListPropertyTest.java	9 Jan 2003 03:24:01 -0000	1.5
  @@ -60,15 +60,14 @@
   import junit.framework.TestSuite;
   
   import org.apache.commons.clazz.Clazz;
  -import org.apache.commons.clazz.ClazzLoader;
  -import org.apache.commons.clazz.reflect.ReflectedListPropertyTestSupport;
  +import org.apache.commons.clazz.reflect.ReflectedListPropertyTestCommon;
   
   /**
    * 
    * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
    * @version $Id$
    */
  -public class ExtendedReflectedListPropertyTest extends ReflectedListPropertyTestSupport
  +public class ExtendedReflectedListPropertyTest extends ReflectedListPropertyTestCommon
   {
       /**
        * Constructor for ReflectedPropertyMapTest.
  
  
  
  1.4       +3 -4      jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/ExtendedReflectedOperationTest.java
  
  Index: ExtendedReflectedOperationTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/ExtendedReflectedOperationTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ExtendedReflectedOperationTest.java	7 Jan 2003 00:43:51 -0000	1.3
  +++ ExtendedReflectedOperationTest.java	9 Jan 2003 03:24:01 -0000	1.4
  @@ -54,15 +54,14 @@
   package org.apache.commons.clazz.reflect.extended;
   
   import org.apache.commons.clazz.Clazz;
  -import org.apache.commons.clazz.ClazzLoader;
  -import org.apache.commons.clazz.reflect.ReflectedOperationTest;
  +import org.apache.commons.clazz.reflect.ReflectedOperationCommon;
   
   /**
    * 
    * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
    * @version $Id$
    */
  -public class ExtendedReflectedOperationTest extends ReflectedOperationTest {
  +public class ExtendedReflectedOperationTest extends ReflectedOperationCommon {
   
       /**
        * Constructor for ExtendedReflectedOperationTest.
  
  
  
  1.5       +1 -2      jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/ReflectedMappedPropertyTest.java
  
  Index: ReflectedMappedPropertyTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/ReflectedMappedPropertyTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ReflectedMappedPropertyTest.java	7 Jan 2003 00:43:51 -0000	1.4
  +++ ReflectedMappedPropertyTest.java	9 Jan 2003 03:24:01 -0000	1.5
  @@ -62,7 +62,6 @@
   import junit.framework.TestSuite;
   
   import org.apache.commons.clazz.Clazz;
  -import org.apache.commons.clazz.ClazzLoader;
   import org.apache.commons.clazz.reflect.ReflectedClazzTestSupport;
   
   /**
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/CustomBean1.java
  
  Index: CustomBean1.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect.extended;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: CustomBean1.java,v 1.1 2003/01/09 03:24:00 dmitri Exp $
   */
  public class CustomBean1 {
  
      private String data;
  
      public String retrieveData() {
          return data;
      }
  
      public void storeData(String data) {
          this.data = data;
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/CustomBean1ExtendedClazz.java
  
  Index: CustomBean1ExtendedClazz.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect.extended;
  
  import org.apache.commons.clazz.ClazzLoader;
  import org.apache.commons.clazz.reflect.common.ReflectedScalarProperty;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: CustomBean1ExtendedClazz.java,v 1.1 2003/01/09 03:24:00 dmitri Exp $
   */
  public class CustomBean1ExtendedClazz extends ExtendedReflectedClazz {
  
      public CustomBean1ExtendedClazz(ClazzLoader loader, Class instanceClass) {
          super(loader, instanceClass);
      }
      
      protected void introspectProperties() {
          super.introspectProperties();
          
          ReflectedScalarProperty property = 
                  new ReflectedScalarProperty(this, "data");
      
          Class javaClass = CustomBean1.class;
          try { 
              property.setReadMethod(
                  javaClass.getMethod("retrieveData", null));
              property.setWriteMethod(
                  javaClass.getMethod("storeData", new Class[]{String.class}));
          }
          catch (NoSuchMethodException e){            
          }
          addProperty(property);   
      }
  
  }
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/CustomBean1ExtendedClazzTest.java
  
  Index: CustomBean1ExtendedClazzTest.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect.extended;
  
  import java.util.List;
  
  import org.apache.commons.clazz.Clazz;
  import org.apache.commons.clazz.ClazzLoader;
  import org.apache.commons.clazz.ClazzProperty;
  import org.apache.commons.clazz.ClazzTestSupport;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: CustomBean1ExtendedClazzTest.java,v 1.1 2003/01/09 03:24:00 dmitri Exp $
   */
  public class CustomBean1ExtendedClazzTest extends ClazzTestSupport
  {
      private Clazz clazz;
      
      /**
       * Constructor for ReflectedClazzTestSupport.
       * @param name
       */
      public CustomBean1ExtendedClazzTest(String name) {
          super(name);
      }
  
      public void setUp(){
          // Step 1. Obtain a ClazzLoader for the custom clazz model.
          ClazzLoader clazzLoader =
              Clazz.getClazzLoader(
                  Clazz.EXTENDED_CLAZZ_MODEL,
                  getClass().getClassLoader());
  
          // Step 2. Find the Clazz
          clazz = clazzLoader.getClazzForName(CustomBean1.class.getName());
      }
      
      public void testCustomClazzRecognition(){
          assertTrue(
              "Custom Clazz recognized",
              clazz instanceof CustomBean1ExtendedClazz);
      }
      
      public void testPropertyRecognition(){
          List properties = clazz.getProperties();
          assertEquals("All properties found", 1, properties.size());
          
          CustomBean1 bean = new CustomBean1();
          
          ClazzProperty property = clazz.getProperty("data");
          assertNotNull("Property found", property);
          
          property.set(bean, "foo");
          
          Object value = property.get(bean);
          
          assertEquals("Property set/get", "foo", value);  
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/CustomBean2.java
  
  Index: CustomBean2.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect.extended;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: CustomBean2.java,v 1.1 2003/01/09 03:24:00 dmitri Exp $
   */
  public class CustomBean2 {
  
      private String data;
  
      public String produceData() {
          return data;
      }
  
      public void consumeData(String data) {
          this.data = data;
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/CustomClazz.java
  
  Index: CustomClazz.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect.extended;
  
  import org.apache.commons.clazz.ClazzLoader;
  import org.apache.commons.clazz.reflect.ReflectedPropertyIntrospector;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: CustomClazz.java,v 1.1 2003/01/09 03:24:00 dmitri Exp $
   */
  public class CustomClazz extends ExtendedReflectedClazz {
  
      protected static final ReflectedPropertyIntrospector[] PROPERTY_INTROSPECTORS =
          new ReflectedPropertyIntrospector[] { new CustomPropertyIntrospector()};
  
      public CustomClazz(ClazzLoader loader, Class instanceClass) {
          super(loader, instanceClass);
      }
  
      protected ReflectedPropertyIntrospector[] getPropertyIntrospectors() {
          return PROPERTY_INTROSPECTORS;
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/CustomClazzLoader.java
  
  Index: CustomClazzLoader.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect.extended;
  
  import org.apache.commons.clazz.Clazz;
  import org.apache.commons.clazz.ModelClazzLoader;
  import org.apache.commons.clazz.reflect.ReflectedClazzLoader;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: CustomClazzLoader.java,v 1.1 2003/01/09 03:24:00 dmitri Exp $
   */
  public class CustomClazzLoader extends ReflectedClazzLoader {
  
      public CustomClazzLoader(
          ModelClazzLoader modelClazzLoader,
          ClassLoader classLoader) 
      {
          super(modelClazzLoader, classLoader);
      }
      
      public boolean isSupportedClass(Class javaClass) {
          return CustomBean2.class.isAssignableFrom(javaClass);
      }
  
      protected Clazz createClazz(Class javaClass) {
          return new CustomClazz(getModelClazzLoader(), javaClass);
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/CustomClazzLoaderTest.java
  
  Index: CustomClazzLoaderTest.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect.extended;
  
  import java.util.List;
  
  import org.apache.commons.clazz.Clazz;
  import org.apache.commons.clazz.ClazzLoader;
  import org.apache.commons.clazz.ClazzLoaderFactory;
  import org.apache.commons.clazz.ClazzProperty;
  import org.apache.commons.clazz.ClazzTestSupport;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: CustomClazzLoaderTest.java,v 1.1 2003/01/09 03:24:01 dmitri Exp $
   */
  public class CustomClazzLoaderTest extends ClazzTestSupport
  {
      private Clazz clazz;
      static {
          ClazzLoaderFactory factory =
              Clazz.getClazzLoaderFactory(Clazz.EXTENDED_CLAZZ_MODEL);
          factory.addClazzLoaderClass(CustomClazzLoader.class);
      }
      
      /**
       * Constructor for ReflectedClazzTestSupport.
       * @param name
       */
      public CustomClazzLoaderTest(String name) {
          super(name);
      }
  
      public void setUp(){
          // Step 1. Obtain a ClazzLoader for the custom clazz model.
          ClazzLoader clazzLoader =
              Clazz.getClazzLoader(
                  Clazz.EXTENDED_CLAZZ_MODEL,
                  getClass().getClassLoader());
  
          // Step 2. Find the Clazz
          clazz = clazzLoader.getClazzForName(CustomBean2.class.getName());
      }
      
      public void testCustomClazzRecognition(){
          assertTrue(
              "Custom Clazz Loader recognized",
              clazz instanceof CustomClazz);
      }
      
      public void testPropertyRecognition(){
          List properties = clazz.getProperties();
          assertEquals("Count properties found", 1, properties.size());
          
          CustomBean2 bean = new CustomBean2();
          
          ClazzProperty property = clazz.getProperty("data");
          assertNotNull("Property found", property);
          
          property.set(bean, "foo");
          
          Object value = property.get(bean);
          
          assertEquals("Property set/get", "foo", value);  
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/extended/CustomPropertyIntrospector.java
  
  Index: CustomPropertyIntrospector.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names 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/>.
   */
  package org.apache.commons.clazz.reflect.extended;
  
  import org.apache.commons.clazz.reflect.common.AccessorMethodParser;
  import org.apache.commons.clazz.reflect.common.ReflectedScalarPropertyIntrospector;
  
  /**
   * 
   * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
   * @version $Id: CustomPropertyIntrospector.java,v 1.1 2003/01/09 03:24:01 dmitri Exp $
   */
  public class CustomPropertyIntrospector
      extends ReflectedScalarPropertyIntrospector 
  {
      private static final AccessorMethodParser READ_METHOD_PARSER = 
          new ReadAccessorMethodParser() 
      {
          protected String requiredPrefix(){
              return "produce";
          }
      };
  
      private static final AccessorMethodParser WRITE_METHOD_PARSER = 
          new WriteAccessorMethodParser() 
      {
          protected String requiredPrefix(){
              return "consume";
          }
      };
      
      protected AccessorMethodParser getReadAccessorMethodParser(){
          return READ_METHOD_PARSER;
      }
  
      protected AccessorMethodParser getWriteAccessorMethodParser(){
          return WRITE_METHOD_PARSER;
      }
  }
  
  
  
  1.5       +3 -4      jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/standard/StandardReflectedClazzTest.java
  
  Index: StandardReflectedClazzTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/standard/StandardReflectedClazzTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StandardReflectedClazzTest.java	7 Jan 2003 00:43:51 -0000	1.4
  +++ StandardReflectedClazzTest.java	9 Jan 2003 03:24:01 -0000	1.5
  @@ -56,16 +56,15 @@
   import junit.framework.TestSuite;
   
   import org.apache.commons.clazz.Clazz;
  -import org.apache.commons.clazz.ClazzLoader;
   import org.apache.commons.clazz.reflect.ReflectableInstance;
  -import org.apache.commons.clazz.reflect.ReflectedClazzTest;
  +import org.apache.commons.clazz.reflect.ReflectedClazzTestCommon;
   
   /**
    * 
    * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
    * @version $Id$
    */
  -public class StandardReflectedClazzTest extends ReflectedClazzTest {
  +public class StandardReflectedClazzTest extends ReflectedClazzTestCommon {
   
       /**
        * Constructor for ReflectedClazzTest.
  
  
  
  1.4       +3 -4      jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/standard/StandardReflectedInstanceFactoryTest.java
  
  Index: StandardReflectedInstanceFactoryTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/standard/StandardReflectedInstanceFactoryTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardReflectedInstanceFactoryTest.java	7 Jan 2003 00:43:51 -0000	1.3
  +++ StandardReflectedInstanceFactoryTest.java	9 Jan 2003 03:24:01 -0000	1.4
  @@ -54,15 +54,14 @@
   package org.apache.commons.clazz.reflect.standard;
   
   import org.apache.commons.clazz.Clazz;
  -import org.apache.commons.clazz.ClazzLoader;
  -import org.apache.commons.clazz.reflect.ReflectedOperationTest;
  +import org.apache.commons.clazz.reflect.ReflectedOperationCommon;
   
   /**
    * 
    * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
    * @version $Id$
    */
  -public class StandardReflectedInstanceFactoryTest extends ReflectedOperationTest {
  +public class StandardReflectedInstanceFactoryTest extends ReflectedOperationCommon {
   
       /**
        * Constructor for StandardReflectedOperationTest.
  
  
  
  1.5       +3 -4      jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/standard/StandardReflectedListPropertyTest.java
  
  Index: StandardReflectedListPropertyTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/standard/StandardReflectedListPropertyTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StandardReflectedListPropertyTest.java	7 Jan 2003 00:43:51 -0000	1.4
  +++ StandardReflectedListPropertyTest.java	9 Jan 2003 03:24:01 -0000	1.5
  @@ -58,8 +58,7 @@
   import junit.framework.TestSuite;
   
   import org.apache.commons.clazz.Clazz;
  -import org.apache.commons.clazz.ClazzLoader;
  -import org.apache.commons.clazz.reflect.ReflectedListPropertyTestSupport;
  +import org.apache.commons.clazz.reflect.ReflectedListPropertyTestCommon;
   
   /**
    * 
  @@ -67,7 +66,7 @@
    * @version $Id$
    */
   public class StandardReflectedListPropertyTest 
  -    extends ReflectedListPropertyTestSupport
  +    extends ReflectedListPropertyTestCommon
   {
       /**
        * Constructor for ReflectedPropertyMapTest.
  
  
  
  1.4       +3 -4      jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/standard/StandardReflectedOperationTest.java
  
  Index: StandardReflectedOperationTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/clazz/src/test/org/apache/commons/clazz/reflect/standard/StandardReflectedOperationTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardReflectedOperationTest.java	7 Jan 2003 00:43:51 -0000	1.3
  +++ StandardReflectedOperationTest.java	9 Jan 2003 03:24:01 -0000	1.4
  @@ -54,15 +54,14 @@
   package org.apache.commons.clazz.reflect.standard;
   
   import org.apache.commons.clazz.Clazz;
  -import org.apache.commons.clazz.ClazzLoader;
  -import org.apache.commons.clazz.reflect.ReflectedOperationTest;
  +import org.apache.commons.clazz.reflect.ReflectedOperationCommon;
   
   /**
    * 
    * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
    * @version $Id$
    */
  -public class StandardReflectedOperationTest extends ReflectedOperationTest {
  +public class StandardReflectedOperationTest extends ReflectedOperationCommon {
   
       /**
        * Constructor for StandardReflectedOperationTest.
  
  
  
  1.1                  jakarta-commons-sandbox/clazz/xdocs/overview.xml
  
  Index: overview.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <document>
    <properties>
      <title>
         Clazz Overview
      </title>
      <author email="dmitri@apache.org">
         Dmitri Plotnikov
      </author>
    </properties>
    <body>
      <section name="Clazz">
        <p>
          Clazz is an upgrade to the Java Beans mechanisms, reflecting new
          requirements, new de facto standards and a wider range of potential
          applications.        
        </p>
  <!-- TBD: TOC
        <ul>
          <li><a href="#Requirements">Requirements</a>
            <ul>
              <li><a href="#Project Contributed Requirements">Project Contributed Requirements</a>
              </li>
            </ul>
          </li>
  
          <li><a href="#Clazz Class">Clazz Class</a>
          </li>
          <li><a href="#Client Side of Clazz">Client Side of Clazz</a>
            <ul>
              <li><a href="#Description Provider">Description Provider</a></li>
              <li><a href="#Metadata Provider">Metadata Provider</a></li>
            </ul>
          </li>
        </ul>
  -->
      </section>
  
  
      <section name="Requirements">
        <p>
          Introduced by Stephen Colebourne, here's the initial list of
          requirements (lifted from PROPOSAL.html):
        </p>
        <p>
          The package should:
        </p>
        <p>
          <ul>
              <li>Handle all classes, not just beans</li>
              <li>Support extensible metadata (not just for GUI builders)</li>
              <li>Handle normal (today) bean conventions (get/set/add/put methods)</li>
              <li>Handle future conventions that are not yet standard</li>
              <li>Support method overloading</li>
              <li>Provide a complete alternative to using java.beans.Introspector</li>
              <li>Be simple to learn</li>
          </ul>
        </p>
  
        <subsection name="Project Contributed Requirements">
        <p>
          &lt;TBD&gt; - requirements contributed by potential users of clazz
          go here.
        </p>
        </subsection>
      </section>
  
      <section name="Clazz Class">
        <p>
          The best way to introduce the Clazz class is by comparing it to the
          java.lang.Class class.  Though both serve the same function as runtime 
          meta-data about a type, there are several important differences:
          <ul>
            <li>
              Class is a final class embedded in the JVM. Its behavior cannot be 
              customized or enhanced.  Clazz is an abstract class 
              and allows many alternative implementations.
            </li>
            <li>
              Class describes a Java type in terms of fields, methods and constructors. 
              Clazz describes a type in terms of properties, operations
              and instance factories.  In the case when a Clazz represents a Java class,
              those properties, operations and instance factories may or may not map 
              directly to fields, methods and constructors.  The mapping is determined by the
              implementation of the Clazz and can be quite non-trivial. For example,
              a Clazz may map pairs of Java methods like getFoo() and setFoo() to a 
              single property called "foo". There may be many ways to describe the same
              Java class with a Clazz.
            </li>
            <li>
              Class is restricted to describing Java types. 
              Clazz does not have that limitation.  A Clazz can be created dynamically out 
              of piece parts.
            </li>
          </ul>
        </p>
      </section>
      
      <section name="Client Side of Clazz">
        <p>
          The client sees Clazz as a set of interfaces.
          The following code illustrates a basic interaction between a 
          client and the Clazz package:
        </p>
        
  <!--============================ + SOURCE + ============================-->
  <source>
                                                                         <b/>
  public class MyExample1 {
  
     void listAllOperations(){
     
       // Step 1. Obtain the ClazzLoader associated with the default 
       //         clazz model. Provide a ClassLoader as a context 
       //         for reflection.
       ClazzLoader clazzLoader = 
           Clazz.getDefaultClazzLoader(MyExample1.class.getClassLoader());
  
       // Step 2. Find the Clazz
       Clazz clazz = clazzLoader.getClazzForName("my.example.Example");
       
       // Step 3. Obtain operation descriptions from the clazz
       List operations = clazz.getOperations();
          
       for (Iterator iter = operations.iterator(); iter.hasNext();) {
            ClazzOperation operation = (ClazzOperation) iter.next();
            System.out.println("Operation: " + operation.getSignature());
       }
     }
  }
  
  </source>
  <!--============================ - SOURCE - ============================-->
        <p>
          The <code>getDefaultClazzLoader()</code> static method invokes 
          a ClazzLoaderFactory which allocates and caches ClazzLoaders. 
        </p>
        <p>
          The roles of the three main classes: Clazz, ClazzLoader and
          ClazzLoaderFactory are illustrated by the following diagram (green - 
          interfaces, blue - relationships):
        </p>
        <p>
          <blockquote>
            <img src="images/design.jpg"/>
          </blockquote>
        </p>
  
      </section>
        
      <section name="Runtime Clazzes">
        <p>
          Clazzes can be created dynamically out of piece parts: properties,
          operations, instance factories etc. If the client sticks to the Clazz
          APIs, there is no difference between clazzes created dynamically and
          those based on the reflection of hard Java classes.
        </p>
        
        <subsection name="Creating a Clazz Dynamically">
          <p>
            In the following example we are creating a Clazz with a string
            property called "foo".  
          </p>
          <p>
            We always use a clazz loader to instatiate a new Clazz. The ClazzLoader
            maintains the integrity of inter-clazz references and also
            serves as a cache for clazzes.
            The instantiation method, <code>declareClass</code>, takes three
            parameters: the name of the new clazz, the Java class of the
            new Clazz object and the Java type the instances of the
            Clazz will belong to.
          </p>
  <!--============================ + SOURCE + ============================-->
  <source>
                                                                         <b/>
  public class MyExample2 {
  
     void createCustomClazz(){
                                                                         
       // Step 1. Obtain the ClazzLoader associated with the default 
       //         clazz model. We always provide a class loader as well,
       //         since all ClazzLoaders are associated with ClassLoaders.
       ClazzLoader clazzLoader = 
           Clazz.getDefaultClazzLoader(MyExample2.class.getClassLoader());
  
       // Step 2. Create a new Clazz
       BeanClazz clazz = (BeanClazz) clazzLoader.defineClazz(
              "my.custom.DynamicBean",  // Name of the new clazz
              BeanClazz.class,          // Type of the new clazz
              Bean.class);              // Type of instances of the new clazz
  
       // Step 3. Build the new Clazz out of properties, operations etc
       ClazzProperty prop =
              new BeanClazzProperty(clazz, "foo", "java.lang.String");
       clazz.addDeclaredProperty(prop);
       
       // Step 4. Now we can use the new clazz
       
       Object instance = clazz.newInstance();
       clazz.getProperty("foo").set(instance, "bar");
       
       String value = (String)clazz.getProperty("foo").get(instance);
       
       // This prints "Dynamic property value: bar"
       System.out.println ("Dynamic property value: " + value);
    }
  }
  
  </source>
  <!--============================ - SOURCE - ============================-->
        </subsection>
      </section>
          
      <section name="Clazz Model">
        <p>
          Depending on the application, there may be different ways to 
          represent the same type as a clazz.  A particular method of 
          describing types is a <i>clazz model</i>.  
          Technically a clazz model is managed by a ClazzLoaderFactory.  
          A ClazzLoaderFactory creates ClazzLoaders,
          which in turn create Clazz's according to the requirements of that
          specific model.
        </p>
        <p>
          To introduce a new clazz model, the corresponding ClazzLoaderFactory
          is registered with a unique key.  Clients identify models by such
          keys.        
        </p>
  
  <!--============================ + SOURCE + ============================-->
  <source>
                                                                         <b/>
  public class MyExample2 {
  
     // Create and register a ClazzLoaderFactory for a custom model
     static {
        Clazz.setClazzLoaderFactory("myclazzes", new MyClazzLoaderFactory());
     }
     
     
     void listAllProperties(){
     
       // Step 1. Obtain a ClazzLoader for the custom clazz model.
       ClazzLoader clazzLoader = 
           Clazz.getClazzLoader("myclazzes", MyExample.class.getClassLoader());
  
       // Step 2. Find the Clazz
       Clazz clazz = clazzLoader.getClazzForName("my.example.Example");
       
       // Step 3. Obtain property descriptions from the clazz
       List properties = clazz.getProperties();
       ...
       for (Iterator iter = properties.iterator(); iter.hasNext();) {
            ClazzProperty property = (ClazzProperty) iter.next();
            System.out.println("Property: " + property.getName());
       }
     }
  }
  
  </source>
  <!--============================ - SOURCE - ============================-->
  
        <p>
          &lt;TBD&gt; - if more models are added, mention them here.
        </p>
  
        <p>
          The Clazz package comes with two clazz model out of the box:
          <code>"Standard"</code> and <code>"Extended"</code>.
        </p>
        <p>
          The Standard model implements class introspection according to
          the JavaBean specification.  
        </p>
        <p>        
          The Extended model implement a 
          more "modern" definition of beans, the one that recognizes 
          "add", "remove", etc methods, supports List and Mapped properties,
          allows the use of plural form of the property name etc.        
        </p>
      </section>
      
      
      <section name="Clazz Loader">
        <p>
          A ClazzLoader is responsible for creating and caching of
          clazzes.  Typically a ClazzLoader returned by a ClazzLoaderFactory
          is a mere front for a whole family of ClazzLoaders, each responsible
          for its own "kind" of Clazzes.  For instance, a ClazzLoader performing
          reflection will typically not be the same ClazzLoader as the one
          managing types not based on reflection.  To facilitate the creation
          of such families of ClazzLoaders, the package provides such
          aggregating ClazzLoader implementations as GroupClazzLoader and 
          CachingGroupClazzLoader.
        </p>
      </section>
        
      <section name="Extended Property Types">
        <p>
          TBD
        </p>
        <subsection name="List Property">
          <p>
            TBD
          </p>
        </subsection>
        <subsection name="Mapped Property">
          <p>
            TBD
          </p>
        </subsection>
      </section>
      
      <section name="Customization">
        <p>
          Customizability is the most important aspect of the Clazz package.
          There are many points of customization and choosing the right one
          for your task is very important.
        </p>
        
        <subsection name="Customizing an Individual Reflected Clazz">
          <p>
            Let's say we have a class Bean1 that has the property "data",
            which is accessed with unusual methods: "storeData" and "retrieveData".
            The implementations of ReflectionClazz included in the Clazz package
            are only programmed to detect accessor methods with signatures 
            like "setData" and "getData", therefore they will not recognize 
            these non-standard accessors. 
          </p>
          <p>
            We will address the problem by creating a customized implementation
            of Clazz.  We will subclass one of the regular implementations
            and modify its behavior. 
          </p>
          <p>
            We put the custom implementation of Clazz into the same package
            as the class itself and name it 
            <code><i>&lt;Class&gt;&lt;Model&gt;</i>Clazz</code>.
            By naming the implementaion like this, we make it possible for
            the ClazzLoader to discover and load it.
          </p>
          <p>
            In our particular scenario "data" will not be automatically
            recognized as a property at all, because it does not have any
            standard accessors.  Therefore, we will have to create and
            register that property explicitly.           
          </p>
          
  <!--============================ + SOURCE + ============================-->
  <source>
                                                                         <b/>
  public class Bean1ExtendedClazz extends ExtendedReflectedClazz {
  
      public Bean1ExtendedClazz(ClazzLoader loader, Class instanceClass) {
          super(loader, instanceClass);
      }
      
      protected void introspectProperties() {
          super.introspectProperties();
          
          ReflectedScalarProperty property = 
                  new ReflectedScalarProperty(this, "data");
      
          Class javaClass = Bean1.class;
          try { 
              property.setReadMethod(
                  javaClass.getMethod("retrieveData", null));
              property.setWriteMethod(
                  javaClass.getMethod("storeData", new Class[]{String.class}));
          }
          catch (NoSuchMethodException e){            
          }
          
          addProperty(property);   
      }
  
  }
  </source>
  <!--============================ - SOURCE - ============================-->
  
          <p>
            Now, let's say one of the accessors is the standard "getData",
            while the other one is the unusual "storeData".  This case is 
            different in that the standard implementation of ReflectedClazz
            will recognize the property "data", but will not associate it
            with the non-standard accessor.  All we need to do in this case
            is find the property and link it with the accessor.
          </p>
          
  <!--============================ + SOURCE + ============================-->
  <source>
                                                                         <b/>
  public class Bean2ExtendedClazz extends ExtendedReflectedClazz {
  
      public Bean2ExtendedClazz(ClazzLoader loader, Class instanceClass) {
          super(loader, instanceClass);
      }
      
      protected void introspectProperties() {
          super.introspectProperties();
          
          ReflectedScalarProperty property = getProperty("data");
      
          Class javaClass = Bean2.class;
          try { 
              property.setWriteMethod(
                  javaClass.getMethod("storeData", new Class[]{String.class}));
          }
          catch (NoSuchMethodException e){            
          }
      }
  
  }
  </source>
  <!--============================ - SOURCE - ============================-->
  
          <p>
            Finally, consider class Bean3 that has a method 
            "getDataAsStream()". This method has a typical
            accessor signature, therefore ReflectedClazz will recognize
            "dataAsStream" as a legitimate property.  If we don't want
            it to be recognized as a property, we can filter it out like this:
          </p>
          
  <!--============================ + SOURCE + ============================-->
  <source>
                                                                         <b/>
  public class Bean3ExtendedClazz extends ExtendedReflectedClazz {
  
      public Bean3ExtendedClazz(ClazzLoader loader, Class instanceClass) {
          super(loader, instanceClass);
      }
      
      protected void addProperty(ClazzProperty property) {
          if (property.getName().equals("dataAsStream")){
              return;
          }
          
          super.addProperty(property);
      }
  }
  </source>
  <!--============================ - SOURCE - ============================-->
  
        </subsection>
        
        <subsection name="Customizing a Family of Reflected Clazzes">
          <p>
            In the previous section we examined customization of an
            individual clazz.  More commonly we need to customize a whole
            family of Clazzes in a similar fashion.  Let's say in our
            application all classes implementing a "PersistentBean"
            interface follow the same naming convention for accessors:
            the read method is always called "retrieve<i>Foo</i>" and
            the write method is always "store<i>Foo</i>".
            Instead of customizing each of the clazzes independently,
            we can introduce a generic customization for all of them.
          </p>
          <p>
            ReflectedClazz uses <i>introspectors</i> to recognize 
            properties, operations etc.  An introspector, in turn,
            uses <code>AccessorMethodParser</code>s to recognize accessor
            methods.  Each parser is responsible for a certain type of
            accessor: read, write, etc.  So, we will need two custom 
            parsers: one for the "retrieve..." methods and one 
            for the "store..." methods. Since these parsers are very
            simple, we will implement them as anonymous inner classes.
          </p>
  <!--============================ + SOURCE + ============================-->
  <source>
                                                                         <b/>
  public class CustomPropertyIntrospector
      extends ReflectedScalarPropertyIntrospector 
  {
      private static final AccessorMethodParser READ_METHOD_PARSER = 
          new ReadAccessorMethodParser()
      {
          protected String requiredPrefix(){
              return "retrieve";
          }
      };
  
      protected AccessorMethodParser getReadAccessorMethodParser(){
          return READ_METHOD_PARSER;
      }
  
      private static final AccessorMethodParser WRITE_METHOD_PARSER = 
          new WriteAccessorMethodParser() 
      {
          protected String requiredPrefix(){
              return "store";
          }
      };
      
      protected AccessorMethodParser getWriteAccessorMethodParser(){
          return WRITE_METHOD_PARSER;
      }
  }
  </source>
  <!--============================ - SOURCE - ============================-->
          <p>
            The next step is to write a custom implementation of Clazz. This
            implementation will be the same as its superclass, 
            StandardReflectedClazz, with the exception of the way it recognizes
            properties. The custom clazz will use the above custom property
            introspector.
          </p>
  <!--============================ + SOURCE + ============================-->
  <source>
                                                                         <b/>
  public class CustomClazz extends StandardReflectedClazz {
  
      protected static final 
              ReflectedPropertyIntrospector[] PROPERTY_INTROSPECTORS =
          new ReflectedPropertyIntrospector[] {
              new CustomPropertyIntrospector() 
          };
  
  
      public CustomClazz(ClazzLoader loader, Class instanceClass) {
          super(loader, instanceClass);
      }
  
      protected ReflectedPropertyIntrospector[] getPropertyIntrospectors() {
          return PROPERTY_INTROSPECTORS;
      }
  }
  </source>
  <!--============================ - SOURCE - ============================-->
          <p>
            Now we need to create a custom Clazz Loader that will produce 
            instances of CustomClazz for all classes implementing the
            PersistentBean interface.
          </p>
  <!--============================ + SOURCE + ============================-->
  <source>
                                                                         <b/>
  public class CustomClazzLoader extends ReflectedClazzLoader {
  
      public CustomClazzLoader(
          ModelClazzLoader modelClazzLoader,
          ClassLoader classLoader) 
      {
          super(modelClazzLoader, classLoader);
      }
      
      public boolean isSupportedClass(Class javaClass) {
          return PersistentBean.class.isAssignableFrom(javaClass);
      }
  
      protected Clazz createClazz(Class javaClass) {
          return new CustomClazz(getModelClazzLoader(), javaClass);
      }
  }
  
  </source>
  <!--============================ - SOURCE - ============================-->
  
          <p>
            The final step is to statically register the custom clazz loader.
            A clazz loader belongs to some clazz model, perhaps the default
            one.  In the registration process we associate the clazz loader
            we created with the corresponding model.
          </p>
  <!--============================ + SOURCE + ============================-->
  <source>
                                                                         <b/>
          ClazzLoaderFactory factory =
              Clazz.getClazzLoaderFactory(Clazz.EXTENDED_CLAZZ_MODEL);
          factory.addClazzLoaderClass(CustomClazzLoader.class);
  
  </source>
  <!--============================ - SOURCE - ============================-->
        </subsection>            
      </section>
        
    </body>
  </document>
  
  
  1.1                  jakarta-commons-sandbox/clazz/xdocs/images/design.jpg
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons-sandbox/clazz/xdocs/images/jakarta-logo.gif
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons-sandbox/clazz/xdocs/images/logo-for-anakia.gif
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons-sandbox/clazz/xdocs/images/logo.jpg
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons-sandbox/clazz/xdocs/stylesheets/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <project name="Commons - Clazz" href="http://jakarta.apache.org/commons/clazz">
      <title>Clazz</title>
      <logo href="/images/logo-for-anakia.gif">Clazz</logo>
  
      <!--
        Note: Per the .vsl file, "/site" links will be prefixed with "http://jakarta.apache.org/site"
              Other links starting with "/" become "./...".
      -->
      <body>
         <menu name="Home">
             <item name="Jakarta&amp;nbsp;Commons"          href="http://jakarta.apache.org/commons/" />
             <item name="Clazz"                        href="/overview.html" />
         </menu>
         <menu name="Information">
             <item name="Overview"                      href="/overview.html"/>
             <item name="API&amp;nbsp;Docs"        href="/apidocs/index.html"/>
  <!--
             <item name="News"                          href="http://jakarta.apache.org/commons/pool/news.html"/>
             <item name="User's Guide"                  href="/users-guide.html"/>
  -->
         </menu>
         <menu name="Project Files">
             <item name="Status"                        href="http://cvs.apache.org/viewcvs/~checkout~/jakarta-commons-sandbox/clazz/STATUS.html?content-type=text/html"/>
             <item name="CVS"                           href="http://cvs.apache.org/viewcvs/jakarta-commons/clazz/"/>
             <item name="Original&amp;nbsp;Proposal"    href="http://cvs.apache.org/viewcvs/~checkout~/jakarta-commons-sandbox/clazz/PROPOSAL.html?content-type=text/html"/>
         </menu>
         <menu name="Downloads">
  <!--
             <item name="Release"                       href="http://jakarta.apache.org/builds/jakarta-commons/release/commons-clazz/"/>
             <item name="Nightly Build"                 href="http://jakarta.apache.org/builds/jakarta-commons/nightly/commons-clazz/"/>
  -->
         </menu>
         <menu name="About Us">
             <item name="Contributors"                  href="/contributors.html"/>
             <item name="License"                       href="http://jakarta.apache.org/commons/license.html"/>
         </menu>
         <menu name="Jakarta Community">
             <item name="Get&amp;nbsp;Involved"             href="http://jakarta.apache.org/site/getinvolved.html"/>
             <item name="Mailing&amp;nbsp;Lists"            href="http://jakarta.apache.org/site/mail.html"/>
             <item name="CVS&amp;nbsp;Repositories"         href="http://jakarta.apache.org/site/cvsindex.html"/>
         </menu>
      </body>
  </project>
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message