de.java2html.commandline
Class AbstractJava2HtmlConversion

java.lang.Object
  extended by de.java2html.commandline.AbstractJava2HtmlConversion
All Implemented Interfaces:
IJava2HtmlConversion
Direct Known Subclasses:
Java2HtmlDirectoryConversion, Java2HtmlFileConversion

public abstract class AbstractJava2HtmlConversion
extends java.lang.Object
implements IJava2HtmlConversion


Constructor Summary
AbstractJava2HtmlConversion(IJavaSourceConverter converter, JavaSourceConversionOptions options)
           
 
Method Summary
protected  void convertFile(java.io.File sourceFile, java.io.File targetFile)
          Converts the source file to the targetfile using the specified converter
 JavaSourceConversionOptions getConversionOptions()
           
 IJavaSourceConverter getConverter()
           
protected  java.lang.String readAndConvert(java.io.File sourceFile)
          Invoke the converter on the specified file and return the converted contents.
protected  byte[] readFile(java.io.File file)
          Read the contents from the specified file name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.java2html.commandline.IJava2HtmlConversion
execute
 

Constructor Detail

AbstractJava2HtmlConversion

public AbstractJava2HtmlConversion(IJavaSourceConverter converter,
                                   JavaSourceConversionOptions options)
Method Detail

getConversionOptions

public final JavaSourceConversionOptions getConversionOptions()
Specified by:
getConversionOptions in interface IJava2HtmlConversion

getConverter

public final IJavaSourceConverter getConverter()
Specified by:
getConverter in interface IJava2HtmlConversion

readFile

protected byte[] readFile(java.io.File file)
                   throws java.io.IOException
Read the contents from the specified file name.

Parameters:
file -
Returns:
byte[]
Throws:
java.io.IOException

readAndConvert

protected java.lang.String readAndConvert(java.io.File sourceFile)
                                   throws java.io.IOException
Invoke the converter on the specified file and return the converted contents.

Parameters:
sourceFile - The file to be converted
Returns:
a String containing the converted result
Throws:
java.io.IOException - when there is an io error reading the file.

convertFile

protected void convertFile(java.io.File sourceFile,
                           java.io.File targetFile)
Converts the source file to the targetfile using the specified converter

Parameters:
sourceFile -
targetFile - the target file to write the output to or null if the converter shall determine an appropriate name for the output file itself.