de.java2html.converter
Class AbstractJavaSourceConverter

java.lang.Object
  extended by de.java2html.converter.AbstractJavaSourceConverter
All Implemented Interfaces:
IJavaSourceConverter
Direct Known Subclasses:
AbstractJavaSourceToXmlConverter, JavaSource2HTMLConverter, JavaSource2RtfConverter, JavaSource2TeXConverter

public abstract class AbstractJavaSourceConverter
extends java.lang.Object
implements IJavaSourceConverter

Abstract superclass for all converters for converting a TypedSource object to anything else. For questions, suggestions, bug-reports, enhancement-requests etc. I may be contacted at: markus@jave.de The Java2html home page is located at: http://www.java2html.de

Version:
2.0, 05/07/02 Copyright (C) Markus Gebhard 2000-2002 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Author:
Markus Gebhard

Constructor Summary
AbstractJavaSourceConverter(ConverterMetaData metaData)
           
 
Method Summary
abstract  void convert(TypedSource source, JavaSourceConversionOptions options, java.io.BufferedWriter writer)
           
 void convert(TypedSource source, JavaSourceConversionOptions options, java.io.Writer writer)
          Is called to convert the object 'source' to the destination format.
abstract  java.lang.String getBlockSeparator(JavaSourceConversionOptions options)
          Returns the code that has to be placed between two blocks of converted code.
 java.lang.String getDefaultFileExtension()
          Returns the default filename extension for the output format of this converter, e.g.
abstract  java.lang.String getDocumentFooter(JavaSourceConversionOptions options)
          Returns a footer for the result document.
abstract  java.lang.String getDocumentHeader(JavaSourceConversionOptions options, java.lang.String title)
          Returns a header for the result document.
 ConverterMetaData getMetaData()
           
 void writeBlockSeparator(java.io.Writer writer, JavaSourceConversionOptions options)
           
 void writeDocumentFooter(java.io.Writer writer, JavaSourceConversionOptions options)
           
 void writeDocumentHeader(java.io.Writer writer, JavaSourceConversionOptions options, java.lang.String title)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJavaSourceConverter

public AbstractJavaSourceConverter(ConverterMetaData metaData)
Method Detail

convert

public final void convert(TypedSource source,
                          JavaSourceConversionOptions options,
                          java.io.Writer writer)
                   throws java.io.IOException
Is called to convert the object 'source' to the destination format. The result is stored in 'result' and can be retrieved by calling getResult().

Specified by:
convert in interface IJavaSourceConverter
Parameters:
source - The source code to be converted to the output format specified by this converter.
options - the options to be used for conversion.
writer - The writer to write the output to.
Throws:
java.io.IOException - if an output error occures while writing to the given writer.

convert

public abstract void convert(TypedSource source,
                             JavaSourceConversionOptions options,
                             java.io.BufferedWriter writer)
                      throws java.io.IOException
Throws:
java.io.IOException

getDocumentHeader

public abstract java.lang.String getDocumentHeader(JavaSourceConversionOptions options,
                                                   java.lang.String title)
Returns a header for the result document. This one will be placed before the first block of converted code. Subclasses can return an empty String ("") if there is none neccessary.

Parameters:
title -

getDocumentFooter

public abstract java.lang.String getDocumentFooter(JavaSourceConversionOptions options)
Returns a footer for the result document. This one will be placed behind the last block of converted code. Subclasses can return an empty String ("") if there is none neccessary.


getBlockSeparator

public abstract java.lang.String getBlockSeparator(JavaSourceConversionOptions options)
Returns the code that has to be placed between two blocks of converted code. Subclasses can return an empty String ("") if there is none neccessary.


writeDocumentHeader

public void writeDocumentHeader(java.io.Writer writer,
                                JavaSourceConversionOptions options,
                                java.lang.String title)
                         throws java.io.IOException
Specified by:
writeDocumentHeader in interface IJavaSourceConverter
title - An optional title (e.g. for the html title tag) or an empty string or null if none.
Throws:
java.io.IOException

writeDocumentFooter

public void writeDocumentFooter(java.io.Writer writer,
                                JavaSourceConversionOptions options)
                         throws java.io.IOException
Specified by:
writeDocumentFooter in interface IJavaSourceConverter
Throws:
java.io.IOException

writeBlockSeparator

public void writeBlockSeparator(java.io.Writer writer,
                                JavaSourceConversionOptions options)
                         throws java.io.IOException
Specified by:
writeBlockSeparator in interface IJavaSourceConverter
Throws:
java.io.IOException

getDefaultFileExtension

public final java.lang.String getDefaultFileExtension()
Description copied from interface: IJavaSourceConverter
Returns the default filename extension for the output format of this converter, e.g. "html" or "tex".

Specified by:
getDefaultFileExtension in interface IJavaSourceConverter

getMetaData

public final ConverterMetaData getMetaData()
Specified by:
getMetaData in interface IJavaSourceConverter


Copyright © 2003 - 2006