org.tempuri.javacImpl.util
Class FileSystemClassFactoryImpl

java.lang.Object
  |
  +--org.tempuri.javacImpl.util.FileSystemClassFactoryImpl
All Implemented Interfaces:
FileSystemClassFactory, JavaClassReaderFactory, JavaClassWriterFactory, JavaSourceReaderFactory

public class FileSystemClassFactoryImpl
extends java.lang.Object
implements FileSystemClassFactory


Nested Class Summary
static class FileSystemClassFactoryImpl.ClassReaderImpl
           
static class FileSystemClassFactoryImpl.ClassWriterImpl
           
static class FileSystemClassFactoryImpl.SourceReaderImpl
           
 
Constructor Summary
FileSystemClassFactoryImpl()
           
 
Method Summary
 JavaClassReader getClassReader(java.lang.String className)
          Returns a JavaClassReader for the specified class name
 JavaClassWriter getClassWriter(java.lang.String className)
          Called by the compiler for each class it compiles, to handle the generated output.
 JavaSourceReader getSourceReader(java.lang.String className)
          Get a source reader for a Java class.
 java.lang.String makeClassName(java.lang.String fileName)
          Convert a file name to its associated Java class name
 java.lang.String makeFileName(java.lang.String className)
          Convert a class name to its associated file name
 void setBootClassPath(java.lang.String bcp)
           Set the boot class path to use in locating compiled classes.
 void setClassPath(java.lang.String cp)
           Set the class path to use in locating compiled classes.
 void setOutputDir(java.lang.String outputDir)
           Set the source path to use in locating Java source files.
 void setSourcePath(java.lang.String sp)
           Set the source path to use in locating Java source files.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemClassFactoryImpl

public FileSystemClassFactoryImpl()
Method Detail

makeClassName

public java.lang.String makeClassName(java.lang.String fileName)
                               throws java.io.IOException
Description copied from interface: FileSystemClassFactory
Convert a file name to its associated Java class name

Specified by:
makeClassName in interface FileSystemClassFactory
Parameters:
fileName - name of file
Returns:
name of class
java.io.IOException

makeFileName

public java.lang.String makeFileName(java.lang.String className)
                              throws java.io.IOException
Description copied from interface: FileSystemClassFactory
Convert a class name to its associated file name

Specified by:
makeFileName in interface FileSystemClassFactory
Parameters:
className - name of class
Returns:
name of file
java.io.IOException

getSourceReader

public JavaSourceReader getSourceReader(java.lang.String className)
                                 throws java.io.IOException
Description copied from interface: JavaSourceReaderFactory
Get a source reader for a Java class. Called by the compiler for each class it is instructed to compile

Specified by:
getSourceReader in interface JavaSourceReaderFactory
Returns:
a JavaSourceReader for the specified class or null if the source code cannot be found
Throws:
java.io.IOException - if the source code exists but an error obtaining it occured

getClassReader

public JavaClassReader getClassReader(java.lang.String className)
                               throws java.io.IOException
Description copied from interface: JavaClassReaderFactory
Returns a JavaClassReader for the specified class name

Specified by:
getClassReader in interface JavaClassReaderFactory
Parameters:
className - name of class to be read
Returns:
a JavaClassReader for className or null if the class can't be found
Throws:
java.io.IOException - if an error occurs

getClassWriter

public JavaClassWriter getClassWriter(java.lang.String className)
                               throws java.io.IOException
Description copied from interface: JavaClassWriterFactory
Called by the compiler for each class it compiles, to handle the generated output.

Specified by:
getClassWriter in interface JavaClassWriterFactory
Parameters:
className - name of compiled class
Returns:
JavaClassWriter to handle the compiled class
java.io.IOException

setBootClassPath

public void setBootClassPath(java.lang.String bcp)
Description copied from interface: FileSystemClassFactory
 Set the boot class path to use in locating compiled classes.
 Equivalent to the "-bootclasspath" option of javac
 

Specified by:
setBootClassPath in interface FileSystemClassFactory
Parameters:
bcp - string containing directory or jar file paths separated by the java.io.File.pathSeparator

setClassPath

public void setClassPath(java.lang.String cp)
Description copied from interface: FileSystemClassFactory
 Set the class path to use in locating compiled classes.
 Equivalent to the "-classpath" option of javac
 

Specified by:
setClassPath in interface FileSystemClassFactory
Parameters:
cp - string containing directory or jar file paths separated by the java.io.File.pathSeparator

setSourcePath

public void setSourcePath(java.lang.String sp)
Description copied from interface: FileSystemClassFactory
 Set the source path to use in locating Java source files.
 Equivalent to the "-sourcepath" option of javac.
 

Specified by:
setSourcePath in interface FileSystemClassFactory

setOutputDir

public void setOutputDir(java.lang.String outputDir)
Description copied from interface: FileSystemClassFactory
 Set the source path to use in locating Java source files.
 Equivalent to the "-d" option of javac.
 

Specified by:
setOutputDir in interface FileSystemClassFactory
Parameters:
outputDir - string containing the root directory for generated class files