org.apache.tools.ant.loader

Class AntClassLoader2

public class AntClassLoader2 extends AntClassLoader

An implementation of the AntClassLoader suitable for use on post JDK 1.1 platforms
Constructor Summary
AntClassLoader2()
Constructor
Method Summary
protected voidaddPathFile(File pathComponent)
Add a file to the path.
protected ClassdefineClassFromData(File container, byte[] classData, String className)
Define a class given its bytes
protected voiddefinePackage(File container, String className)
Define the package information associated with a class.
protected voiddefinePackage(File container, String packageName, Manifest manifest)
Define the package information when the class comes from a jar with a manifest

Constructor Detail

AntClassLoader2

public AntClassLoader2()
Constructor

Method Detail

addPathFile

protected void addPathFile(File pathComponent)
Add a file to the path. This classloader reads the manifest, if available, and adds any additional class path jars specified in the manifest.

Parameters: pathComponent the file which is to be added to the path for this class loader

Throws: IOException if data needed from the file cannot be read.

defineClassFromData

protected Class defineClassFromData(File container, byte[] classData, String className)
Define a class given its bytes

Parameters: container the container from which the class data has been read may be a directory or a jar/zip file. classData the bytecode data for the class className the name of the class

Returns: the Class instance created from the given data

Throws: IOException if the class data cannot be read.

definePackage

protected void definePackage(File container, String className)
Define the package information associated with a class.

Parameters: container the file containing the class definition. className the class name of for which the package information is to be determined.

Throws: IOException if the package information cannot be read from the container.

definePackage

protected void definePackage(File container, String packageName, Manifest manifest)
Define the package information when the class comes from a jar with a manifest

Parameters: container the jar file containing the manifest packageName the name of the package being defined. manifest the jar's manifest

Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.