FileDocCategorySizeDatePackage
ClassPathElement.javaAPI DocGlassfish v2 API11012Fri May 04 22:34:38 BST 2007com.sun.jdo.api.persistence.enhancer.util

ClassPathElement

public abstract class ClassPathElement extends Object
Abstract base class for components of a class path.

Fields Summary
private ClassPathElement
next
Constructors Summary
ClassPathElement()
Construct a class path element

  
Methods Summary
voidappend(com.sun.jdo.api.persistence.enhancer.util.ClassPathElement another)
Append a class path element to the chain

    ClassPathElement e = this;
    while (e.next() != null)
      e = e.next();
    e.next = another;
  
public abstract java.util.EnumerationclassesInPackage(java.lang.String packageName)
Return an enumeration of all of the class files in the specified package in this class path element.

param
packageName specifies the VM format package name to which class files must belong.
returns
an Enumeration of the VM format class names which can be found. The return value may be null if the class path element is not valid.

static com.sun.jdo.api.persistence.enhancer.util.ClassPathElementcreate(java.lang.String elementSpec)
Create an appropriate type of class path element based on the path element name.

    File element = new File(elementSpec);
    if (!element.isDirectory() &&
	looksLikeZipName(elementSpec))
      return new ZipFileClassPathElement(element);
    else
      return new DirectoryClassPathElement(element);
  
protected static booleanlooksLikeZipName(java.lang.String fname)
Check whether the String "looks" like a zip file name.

    return (fname.length() > 4 &&
	    (fname.regionMatches(true, fname.length() - 4, ".zip", 0, 4) ||//NOI18N
	     fname.regionMatches(true, fname.length() - 4, ".jar", 0, 4)));//NOI18N
  
abstract booleanmatches(java.io.File directory)
Check to see if this ClassPathElement is a directory matching the directory passed in.

com.sun.jdo.api.persistence.enhancer.util.ClassPathElementnext()
Return the next class path element in the chain

    return this.next;
  
voidsetNext(com.sun.jdo.api.persistence.enhancer.util.ClassPathElement next)
Set the the next class path element in the chain

    this.next = next;
  
public abstract ClassFileSourcesourceOf(java.lang.String className)
If this class path element resolves the class, return a ClassFileSource for the class.