polyglot.frontend
Class TargetFactory

java.lang.Object
  extended by polyglot.frontend.TargetFactory

public class TargetFactory
extends java.lang.Object

A TargetFactory is responsible for opening output files.


Field Summary
protected  java.io.File outputDirectory
           
protected  java.lang.String outputExtension
           
protected  boolean outputStdout
           
 
Constructor Summary
TargetFactory(java.io.File outDir, java.lang.String outExt, boolean so)
           
 
Method Summary
 CodeWriter outputCodeWriter(java.io.File f, int width)
           
 java.io.File outputFile(java.lang.String packageName, Source source)
          Return a file object for the output of the source file in the given package.
 java.io.File outputFile(java.lang.String packageName, java.lang.String className, Source source)
          Return a file object for the output of the class in the given package.
 java.io.Writer outputWriter(java.io.File outputFile)
          Open a writer to the output file.
 java.io.Writer outputWriter(java.lang.String packageName, java.lang.String className, Source source)
          Open a writer to the output file for the class in the given package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputDirectory

protected java.io.File outputDirectory

outputExtension

protected java.lang.String outputExtension

outputStdout

protected boolean outputStdout
Constructor Detail

TargetFactory

public TargetFactory(java.io.File outDir,
                     java.lang.String outExt,
                     boolean so)
Method Detail

outputWriter

public java.io.Writer outputWriter(java.lang.String packageName,
                                   java.lang.String className,
                                   Source source)
                            throws java.io.IOException
Open a writer to the output file for the class in the given package.

Throws:
java.io.IOException

outputCodeWriter

public CodeWriter outputCodeWriter(java.io.File f,
                                   int width)
                            throws java.io.IOException
Throws:
java.io.IOException

outputWriter

public java.io.Writer outputWriter(java.io.File outputFile)
                            throws java.io.IOException
Open a writer to the output file.

Throws:
java.io.IOException

outputFile

public java.io.File outputFile(java.lang.String packageName,
                               Source source)
Return a file object for the output of the source file in the given package.


outputFile

public java.io.File outputFile(java.lang.String packageName,
                               java.lang.String className,
                               Source source)
Return a file object for the output of the class in the given package.