db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/metadata ClassDescriptor.java
Date Sat, 01 Nov 2003 20:44:08 GMT
brj         2003/11/01 12:44:08

  Modified:    src/java/org/apache/ojb/broker/metadata ClassDescriptor.java
  Log:
  new methods getAllConcreteExtentClasses, getAllExtentClasses
  to return extents of the hierarchy
  
  Revision  Changes    Path
  1.69      +50 -14    db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java
  
  Index: ClassDescriptor.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- ClassDescriptor.java	25 Oct 2003 23:59:26 -0000	1.68
  +++ ClassDescriptor.java	1 Nov 2003 20:44:08 -0000	1.69
  @@ -58,17 +58,9 @@
   import java.lang.reflect.Constructor;
   import java.lang.reflect.Method;
   import java.lang.reflect.Modifier;
  +import java.lang.reflect.Proxy;
   import java.sql.Timestamp;
  -import java.util.ArrayList;
  -import java.util.Arrays;
  -import java.util.Collection;
  -import java.util.Collections;
  -import java.util.Date;
  -import java.util.HashMap;
  -import java.util.Iterator;
  -import java.util.List;
  -import java.util.Map;
  -import java.util.Vector;
  +import java.util.*;
   
   import org.apache.commons.lang.builder.ToStringBuilder;
   import org.apache.commons.lang.builder.ToStringStyle;
  @@ -82,9 +74,6 @@
   import org.apache.ojb.broker.util.configuration.Configurator;
   import org.apache.ojb.broker.util.configuration.impl.OjbConfigurator;
   import org.apache.ojb.broker.util.logging.LoggerFactory;
  -
  -//#ifdef JDK13
  -import java.lang.reflect.Proxy;
   //#else
   /*
   import com.develop.java.lang.reflect.Proxy;
  @@ -594,6 +583,53 @@
           return extentClasses;
       }
   
  +
  +    /**
  +     * Return all concrete extent classes of the hierarchy recursively
  +     * @return Collection
  +     */
  +    public Collection getAllConcreteExtentClasses()
  +    {
  +        Set result = new HashSet();
  +        Vector extents = getExtentClasses();
  +        
  +        for (int i = 0; i < extents.size(); i++)
  +        {
  +            Class ext = (Class)extents.elementAt(i);
  +            ClassDescriptor extCld = getRepository().getDescriptorFor(ext);
  +            
  +            if (!extCld.isInterface())
  +            {    
  +                result.add(ext);
  +            }
  +            result.addAll(extCld.getAllConcreteExtentClasses());
  +        }
  +        
  +        return result;
  +    }
  +
  +    /**
  +     * Return all extent classes of the hierarchy recursively
  +     * @return Collection
  +     */
  +    public Collection getAllExtentClasses()
  +    {
  +        Set result = new HashSet();
  +        Vector extents = getExtentClasses();
  +        
  +        for (int i = 0; i < extents.size(); i++)
  +        {
  +            Class ext = (Class)extents.elementAt(i);
  +            ClassDescriptor extCld = getRepository().getDescriptorFor(ext);
  +            
  +            result.add(ext);
  +            result.addAll(extCld.getAllExtentClasses());
  +        }
  +        
  +        return result;
  +    }
  +
  +    
       /**
        * Return the names of all classes in this extent
        * @return java.util.Vector a Vector containing the fully qualified names
  
  
  

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


Mime
View raw message