com.meyling.principia.html
Class Module2Html

java.lang.Object
  |
  +--com.meyling.principia.html.Module2Html

public final class Module2Html
extends Object

This class converts an module into an html file.

Version:
$Revision 0.00.50$
Author:
Michael Meyling

Field Summary
private  Module module
          for converting a String into an (Argument) class
private  String moduleAddress
          address of module to convert
 
Constructor Summary
Module2Html(String moduleAddress)
          Constructor.
 
Method Summary
static String createRelativeAddress(String orgin, String next)
          Create relative address from orgin to next.
static String createRelativeHtmlAddress(String orgin, String next)
          Create relative html address from orgin to next.
static String stripTags(String text)
          Strip html tags out of text.
static String toHtml(String text)
          Escape certain control seqences: ", &.
 void writeFormula(Argument argument, Output output)
          Convert a Formula or its sub arguments into html.
 void writeModule()
          Convert a Module (referenced by module address in constructor) into html.
private  void writeParagraphList(ParagraphList paragraphs, Output output)
          Convert a ParagraphList into html.
 void writeProofLine(ProofLine line, Output output, String label)
          Convert a ProofLine into html.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

module

private Module module
for converting a String into an (Argument) class

moduleAddress

private final String moduleAddress
address of module to convert
Constructor Detail

Module2Html

public Module2Html(String moduleAddress)
Constructor.
Parameters:
moduleAddress - convert module at this address
Method Detail

writeModule

public final void writeModule()
                       throws ParsingException,
                              IOException
Convert a Module (referenced by module address in constructor) into html.
Throws:
ParsingException - if any parsing error occurs
IOException - if any file problem occurs

writeParagraphList

private final void writeParagraphList(ParagraphList paragraphs,
                                      Output output)
Convert a ParagraphList into html.
Parameters:
paragraphs - convert this
output - destination for resulting html code

writeProofLine

public final void writeProofLine(ProofLine line,
                                 Output output,
                                 String label)
Convert a ProofLine into html.
Parameters:
line - convert this
output - destination for resulting html code
label - for proof line references

writeFormula

public final void writeFormula(Argument argument,
                               Output output)
Convert a Formula or its sub arguments into html.
Parameters:
argument - convert this
output - destination for resulting html code

toHtml

public static final String toHtml(String text)
Escape certain control seqences: ", &. Doesn't escape <: or >!
Parameters:
text - excape this text
Returns:
escaped text

stripTags

public static final String stripTags(String text)
Strip html tags out of text.
Parameters:
text - strip this text
Returns:
striped text

createRelativeAddress

public static final String createRelativeAddress(String orgin,
                                                 String next)
Create relative address from orgin to next. // TODO: correct for complicated relative addresses...
Parameters:
orgin - this is the original location (URL!)
next - this should be the next location (URL!)
Returns:
relative (or if neccessary absolute) address

createRelativeHtmlAddress

public static final String createRelativeHtmlAddress(String orgin,
                                                     String next)
Create relative html address from orgin to next.
Parameters:
orgin - this is the original location of the module(URL!)
next - this should be the next location of a module(URL!)
Returns:
relative (or if neccessary absolute) address of html module