textmaven.application.analyzer.annotator
Class HTMLWriter

java.lang.Object
  extended bytextmaven.application.analyzer.annotator.HTMLWriter

public class HTMLWriter
extends java.lang.Object

This class generates a HTML file. The file is eventually generated by calls to writeHTMLHeader, several write and writeHTMLFooter calls. It will typically contain the basic text which is converted to HTML.

The method write(String,String) writes the word specified in the first parameter to the output file, basically hyperlinking it to a anchor specified by the second parameter within the translation frame.

Author:
krebtho

Constructor Summary
HTMLWriter()
          Standard constructor
HTMLWriter(java.io.PrintWriter out, java.lang.String vocabFrameName, java.lang.String vocabFileName)
          Constructor
 
Method Summary
 java.net.URL getResourceDir()
           
 java.io.PrintWriter getTextWriter()
           
 java.lang.String getVocabFileName()
           
 java.lang.String getVocabFrameName()
           
 void setResourceDir(java.net.URL resourceDir)
           
 void setTextWriter(java.io.PrintWriter textOut)
           
 void setVocabFileName(java.lang.String vocabFileName)
           
 void setVocabFrameName(java.lang.String vocabFrameName)
           
 void write(java.lang.String str)
          Writes specified string to HTML file
 void write(java.lang.String word, java.lang.String linkTarget)
          Writes word to HTML file.
 void writeAnchor(int id)
          Writes bookmark link and anchor.
 void writeHTMLFooter()
          Writes footer to HTML file
 void writeHTMLHeader()
          Writes header to HTML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLWriter

public HTMLWriter()
Standard constructor


HTMLWriter

public HTMLWriter(java.io.PrintWriter out,
                  java.lang.String vocabFrameName,
                  java.lang.String vocabFileName)
Constructor

Parameters:
out - writer into which HTML text is written
vocabFrameName - name of vocabulary frame
vocabFileName - vocabulary file name
Method Detail

writeHTMLHeader

public void writeHTMLHeader()
Writes header to HTML file.


writeHTMLFooter

public void writeHTMLFooter()
Writes footer to HTML file


write

public void write(java.lang.String str)
Writes specified string to HTML file

Parameters:
str - string to be printed

write

public void write(java.lang.String word,
                  java.lang.String linkTarget)
Writes word to HTML file. Word will be hyperlinked to vocabframe#linkTarget

Parameters:
word - word to write
linkTarget - linktarget to be used as anchor in vocab frame

writeAnchor

public void writeAnchor(int id)
Writes bookmark link and anchor.

Parameters:
id - bookmark anchor

getTextWriter

public java.io.PrintWriter getTextWriter()
Returns:
Returns the writert.

setTextWriter

public void setTextWriter(java.io.PrintWriter textOut)
Parameters:
textOut - The writer to set.

getResourceDir

public java.net.URL getResourceDir()
Returns:
Returns the resourceDir.

setResourceDir

public void setResourceDir(java.net.URL resourceDir)
                    throws java.net.MalformedURLException
Parameters:
resourceDir - The resourceDir to set.
Throws:
java.net.MalformedURLException

getVocabFileName

public java.lang.String getVocabFileName()
Returns:
Returns the vocabFileName.

setVocabFileName

public void setVocabFileName(java.lang.String vocabFileName)
Parameters:
vocabFileName - The vocabFileName to set.

getVocabFrameName

public java.lang.String getVocabFrameName()
Returns:
Returns the vocabFrameName.

setVocabFrameName

public void setVocabFrameName(java.lang.String vocabFrameName)
Parameters:
vocabFrameName - The vocabFrameName to set.


Copyright © 2002-2005 Sourceforge. All Rights Reserved.