Update of /cvsroot/xdoclet/xdoclet2/src/java/xdoclet/util
In directory sc8-pr-cvs1:/tmp/cvs-serv13012/src/java/xdoclet/util

Modified Files:
        ClasspathManager.java 
Added Files:
        XDocletClassLoader.java 
Log Message:
Added Java Beans support. This is in order to make it possible for Bean containers 
(such as IDEs) to configure XDoclet. We're generating BeanInfo and MANIFEST.MF files 
that provide metadata about XDoclet. This is in fact the Metadata API for the 
configuration part of XDoclet.

--- NEW FILE: XDocletClassLoader.java ---
package xdoclet.util;

import java.net.URLClassLoader;
import java.net.URL;
import java.io.InputStream;

/**
 *
 * @author <a href="mailto:aslak.hellesoy at bekk.no">Aslak Helles&oslash;y</a>
 * @version $Revision: 1.1 $
 */
public class XDocletClassLoader extends URLClassLoader {
    public XDocletClassLoader(URL[] urls, ClassLoader parent) {
        super(urls, parent);
    }

    public InputStream getResourceAsStream(String name) {
        return null;
    }
}

Index: ClasspathManager.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet2/src/java/xdoclet/util/ClasspathManager.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** ClasspathManager.java       5 Mar 2003 22:27:11 -0000       1.4
--- ClasspathManager.java       8 Mar 2003 14:21:10 -0000       1.5
***************
*** 15,19 ****
  import java.net.MalformedURLException;
  import java.net.URL;
- import java.net.URLClassLoader;
  
  import java.util.*;
--- 15,18 ----
***************
*** 38,42 ****
      // This is to avoid scanning all the other support jars which might be a bit big 
-> slow.
      private final String _classpath;
!     private URLClassLoader _classpathClassLoader;
  
      /**
--- 37,41 ----
      // This is to avoid scanning all the other support jars which might be a bit big 
-> slow.
      private final String _classpath;
!     private XDocletClassLoader _classpathClassLoader;
  
      /**
***************
*** 62,66 ****
  
      private void initClassLoader() {
!         // Make the classloader
          int i = 0;
  
--- 61,65 ----
  
      private void initClassLoader() {
!         // Tell the classloader about all jars.
          int i = 0;
  
***************
*** 77,84 ****
              }
  
!             _classpathClassLoader = new URLClassLoader(urls, 
getClass().getClassLoader());
          }
      }
  
      public ClassLoader getClassLoader() {
          return _classpathClassLoader;
--- 76,87 ----
              }
  
!             _classpathClassLoader = new XDocletClassLoader(urls, 
getClass().getClassLoader());
          }
      }
  
+     /**
+      * Gets the ClassLoaders that loads all plugin classes.
+      * @return the ClassLoaders that loads all plugin classes.
+      */
      public ClassLoader getClassLoader() {
          return _classpathClassLoader;
***************
*** 169,172 ****
--- 172,179 ----
      }
  
+     /**
+      * Gets the classpath where plugins are looked for.
+      * @return the classpath where plugins are looked for.
+      */
      public String getClasspath() {
          return _classpath;
***************
*** 299,329 ****
      }
  
!     public static class JarFilter implements Predicate, FileFilter {
!         public boolean accept(File file) {
!             return FileUtils.isJar(file);
!         }
  
!         public boolean evaluate(Object o) {
              return accept((File) o);
          }
      }
  
!     public static class DirFilter implements Predicate, FileFilter {
          public boolean accept(File file) {
!             return file.isDirectory();
          }
  
!         public boolean evaluate(Object o) {
!             return accept((File) o);
          }
      }
  
!     public static class ClassFilter implements Predicate, FileFilter {
          public boolean accept(File file) {
              return file.getName().endsWith(".class");
-         }
- 
-         public boolean evaluate(Object o) {
-             return accept((File) o);
          }
      }
--- 306,336 ----
      }
  
!     /**
!      * Adapter class that makes it possible to use a class as both a
!      * Commons Collections Predicate and FileFilter.
!      */
!     public abstract static class FileFilterPredicate implements Predicate, 
FileFilter {
!         public abstract boolean accept(File file);
  
!         public final boolean evaluate(Object o) {
              return accept((File) o);
          }
      }
  
!     public static class JarFilter extends FileFilterPredicate {
          public boolean accept(File file) {
!             return FileUtils.isJar(file);
          }
+     }
  
!     public static class DirFilter extends FileFilterPredicate {
!         public boolean accept(File file) {
!             return file.isDirectory();
          }
      }
  
!     public static class ClassFilter extends FileFilterPredicate {
          public boolean accept(File file) {
              return file.getName().endsWith(".class");
          }
      }



-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to