org.teatrove.tea.util
Class AbstractCompiler.AbstractUnit
java.lang.Object
org.teatrove.tea.compiler.CompilationUnit
org.teatrove.tea.util.AbstractCompiler.AbstractUnit
- All Implemented Interfaces:
- EventListener, ErrorListener
- Direct Known Subclasses:
- FileCompiler.FileUnit
- Enclosing class:
- AbstractCompiler
public abstract class AbstractCompiler.AbstractUnit
- extends CompilationUnit
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mSourceFilePath
protected String mSourceFilePath
mSourceFileName
protected String mSourceFileName
mDotPath
protected String mDotPath
mDestDir
protected File mDestDir
mDestFile
protected File mDestFile
AbstractCompiler.AbstractUnit
protected AbstractCompiler.AbstractUnit(String name,
Compiler compiler)
getTargetPackage
public String getTargetPackage()
- Description copied from class:
CompilationUnit
- Return the package name that this CompilationUnit should be compiled
into. Default implementation returns null, or no package.
- Overrides:
getTargetPackage in class CompilationUnit
getSourceFileName
public String getSourceFileName()
- Specified by:
getSourceFileName in class CompilationUnit
getReader
public Reader getReader()
throws IOException
- Specified by:
getReader in class CompilationUnit
- Returns:
- A new source file reader.
- Throws:
IOException
shouldCompile
public boolean shouldCompile()
- Overrides:
shouldCompile in class CompilationUnit
- Returns:
- true if the CompilationUnit should be compiled. Default is true.
shouldCompile
protected boolean shouldCompile(long timestamp)
getLastModified
protected abstract long getLastModified()
getDestinationLastModified
protected long getDestinationLastModified()
getDestinationFile
public File getDestinationFile()
- Returns:
- the file that gets written by the compiler.
getOutputStream
public OutputStream getOutputStream()
throws IOException
- Specified by:
getOutputStream in class CompilationUnit
- Returns:
- An OutputStream to write compiled code to. Returning null is
disables code generation for this CompilationUnit.
- Throws:
IOException
resetOutputStream
public void resetOutputStream()
- Description copied from class:
CompilationUnit
- Reset the output stream cleaning up or removing any files created as
part of the output stream. This is generally used when an exception
occurs during code generation to the output stream.
- Specified by:
resetOutputStream in class CompilationUnit
getClassName
protected String getClassName()
getClassName
protected String getClassName(String innerClass)
getTemplateSource
protected abstract InputStream getTemplateSource(String templateSourceName)
throws IOException
- Throws:
IOException
Copyright © 1997-2012 TeaTrove.org. All Rights Reserved.