ConForM.CoopnTools.CoKer.DocComment
Class DocWriter

java.lang.Object
  |
  +--java.io.Writer
        |
        +--java.io.PrintWriter
              |
              +--ConForM.CoopnTools.CoKer.DocComment.DocWriter
Direct Known Subclasses:
HTMLDocWriter

public abstract class DocWriter
extends java.io.PrintWriter

Documentation Comment Writer. This abstarct class defines documentation comment writers, which extend simple PrintWriter. The default doc writer format its output in HTML.


Field Summary
protected static int DOC
           
protected  CoopnEnv env
           
protected static int GTOC
           
static int HTML
          HTML doc writer.
protected static int INDEX
           
protected  PackageMgr packageMgr
           
protected static int TOC
           
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
protected DocWriter(java.io.Writer writer, PackageMgr packageMgr, CoopnEnv env)
           
 
Method Summary
abstract  void blankSpace()
          Blank space.
abstract  void defineTargetItem(java.lang.String item)
          Defines a hypertext target item.
abstract  java.io.File documentationFileOf(java.lang.String pointer)
          Get the documentation file associated to a pointer.
abstract  java.io.File documentationFileOf(java.lang.String moduleName, int moduleKind)
          Get the documentation file of a module.
abstract  void endAnchor()
          End a hypertext anchor.
abstract  void endBullet()
          Ends a bullet element.
abstract  void endDefinition()
          End the definition in a definition list.
abstract  void endDefinitionList()
          End a definition list, containing terms and their definitions.
abstract  void endMenu()
          End a Menu, containing bullet elements.
abstract  void endShift()
          End a shift text.
abstract  void endTerm()
          End the term in a definition list.
static java.io.File getDocFile(int format, java.lang.String moduleName, int moduleKind, PackageMgr packageMgr, CoopnEnv env)
          Get the documentation file for a particular format, associated to a module.
static DocWriter getDocWriter(int format, java.lang.String moduleName, int moduleKind, PackageMgr packageMgr, CoopnEnv env)
          Get a documentation writer for a particular format, associated to a module.
static DocWriter getDocWriter(java.io.Writer writer, int format, PackageMgr packageMgr, CoopnEnv env)
          Get a doc writer for a particular format.
static java.io.File getGTocFile(int format, java.lang.String moduleName, int moduleKind, PackageMgr packageMgr, CoopnEnv env)
          Get a general TOC file for a particular format, associated to a module.
static DocWriter getGTocWriter(int format, java.lang.String moduleName, int moduleKind, PackageMgr packageMgr, CoopnEnv env)
          Get a general TOC writer for a particular format, associated to a module.
static java.io.File getIndexFile(int format, java.lang.String moduleName, int moduleKind, PackageMgr packageMgr, CoopnEnv env)
          Get an index file for a particular format, associated to a module.
static DocWriter getIndexWriter(int format, java.lang.String moduleName, int moduleKind, PackageMgr packageMgr, CoopnEnv env)
          Get an index writer for a particular format, associated to a module.
static java.io.File getTocFile(int format, java.lang.String moduleName, int moduleKind, PackageMgr packageMgr, CoopnEnv env)
          Get a TOC file for a particular format, associated to a module.
static DocWriter getTocWriter(int format, java.lang.String moduleName, int moduleKind, PackageMgr packageMgr, CoopnEnv env)
          Get a TOC writer for a particular format, associated to a module.
abstract  java.io.File gtocFileOf(java.lang.String moduleName, int moduleKind)
          Get the general table-of-contents file associated to a module.
abstract  void horizontalRule()
          Horizontal line.
abstract  void lineBreak()
          Line break.
abstract  void printHeader(java.lang.String headerText)
          Print the header.
abstract  void printSection(java.lang.String text)
          Print a sub-title.
abstract  void printSubSection(java.lang.String text)
          Print a sub-sub-title.
abstract  void printSubSubSection(java.lang.String text)
          Print a sub-sub-sub-title.
abstract  void printTitle(java.lang.String text)
          Print a title.
abstract  void printTrailer()
          Print the trailer text.
abstract  void resetBold()
          End a bold face.
abstract  void resetEmphasis()
          End an emphasis text.
abstract  void resetTT()
          End the teletype mode mode.
abstract  void setBold()
          Start a bold face.
abstract  void setEmphasis()
          Start an emphasis text.
abstract  void setTT()
          Start the teletype mode.
abstract  void startAnchor(java.io.File target)
          Start a hypertext anchor on a file.
abstract  void startAnchor(java.io.File target, java.lang.String item)
          Start a hypertext anchor on a file.
abstract  void startAnchor(java.net.URL target)
          Start a hypertext anchor on an URL.
abstract  void startBullet()
          Start a bullet element.
abstract  void startDefinition()
          Start the definition in a definition list.
abstract  void startDefinitionList()
          Start a definition list, containing terms and their definitions.
abstract  void startMenu()
          Start a Menu, containing bullet elements.
abstract  void startShift()
          Start a shift text.
abstract  void startTerm()
          Start the term in a definition list.
static java.lang.String[] supportedFormats(CoopnEnv env)
          Get the supported formats.
abstract  java.io.File tocFileOf(java.lang.String moduleName, int moduleKind)
          Get the index file associated to a module public abstract File indexFileOf(String moduleName, int moduleKind); /**Get the table-of-contents file associated to a module.
 
Methods inherited from class java.io.PrintWriter
checkError, close, flush, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

packageMgr

protected PackageMgr packageMgr

env

protected CoopnEnv env

HTML

public static final int HTML
HTML doc writer.

DOC

protected static final int DOC

INDEX

protected static final int INDEX

TOC

protected static final int TOC

GTOC

protected static final int GTOC
Constructor Detail

DocWriter

protected DocWriter(java.io.Writer writer,
                    PackageMgr packageMgr,
                    CoopnEnv env)
Method Detail

printHeader

public abstract void printHeader(java.lang.String headerText)
Print the header.

printTrailer

public abstract void printTrailer()
Print the trailer text.

printTitle

public abstract void printTitle(java.lang.String text)
Print a title.

printSection

public abstract void printSection(java.lang.String text)
Print a sub-title.

printSubSection

public abstract void printSubSection(java.lang.String text)
Print a sub-sub-title.

printSubSubSection

public abstract void printSubSubSection(java.lang.String text)
Print a sub-sub-sub-title.

startShift

public abstract void startShift()
Start a shift text.

endShift

public abstract void endShift()
End a shift text.

startMenu

public abstract void startMenu()
Start a Menu, containing bullet elements.

endMenu

public abstract void endMenu()
End a Menu, containing bullet elements.

startBullet

public abstract void startBullet()
Start a bullet element.

endBullet

public abstract void endBullet()
Ends a bullet element.

startDefinitionList

public abstract void startDefinitionList()
Start a definition list, containing terms and their definitions.

endDefinitionList

public abstract void endDefinitionList()
End a definition list, containing terms and their definitions.

startTerm

public abstract void startTerm()
Start the term in a definition list.

endTerm

public abstract void endTerm()
End the term in a definition list.

startDefinition

public abstract void startDefinition()
Start the definition in a definition list.

endDefinition

public abstract void endDefinition()
End the definition in a definition list.

setTT

public abstract void setTT()
Start the teletype mode.

resetTT

public abstract void resetTT()
End the teletype mode mode.

setEmphasis

public abstract void setEmphasis()
Start an emphasis text.

resetEmphasis

public abstract void resetEmphasis()
End an emphasis text.

setBold

public abstract void setBold()
Start a bold face.

resetBold

public abstract void resetBold()
End a bold face.

horizontalRule

public abstract void horizontalRule()
Horizontal line.

lineBreak

public abstract void lineBreak()
Line break.

blankSpace

public abstract void blankSpace()
Blank space.

documentationFileOf

public abstract java.io.File documentationFileOf(java.lang.String pointer)
Get the documentation file associated to a pointer.

documentationFileOf

public abstract java.io.File documentationFileOf(java.lang.String moduleName,
                                                 int moduleKind)
Get the documentation file of a module.

tocFileOf

public abstract java.io.File tocFileOf(java.lang.String moduleName,
                                       int moduleKind)
Get the index file associated to a module public abstract File indexFileOf(String moduleName, int moduleKind); /**Get the table-of-contents file associated to a module.

gtocFileOf

public abstract java.io.File gtocFileOf(java.lang.String moduleName,
                                        int moduleKind)
Get the general table-of-contents file associated to a module.

startAnchor

public abstract void startAnchor(java.io.File target)
Start a hypertext anchor on a file.

startAnchor

public abstract void startAnchor(java.io.File target,
                                 java.lang.String item)
Start a hypertext anchor on a file.

startAnchor

public abstract void startAnchor(java.net.URL target)
Start a hypertext anchor on an URL.

endAnchor

public abstract void endAnchor()
End a hypertext anchor.

defineTargetItem

public abstract void defineTargetItem(java.lang.String item)
Defines a hypertext target item.

supportedFormats

public static java.lang.String[] supportedFormats(CoopnEnv env)
Get the supported formats.
Returns:
an array of strings, the indexes of which give the supported format code, and the elements of which give the names of the supported formats.

getDocWriter

public static DocWriter getDocWriter(java.io.Writer writer,
                                     int format,
                                     PackageMgr packageMgr,
                                     CoopnEnv env)
Get a doc writer for a particular format.
Parameters:
writer - the basic Writer to use
format - the format of doc writer, one of the valid indexes of the array returned by supportedFormats
packageMgr - the associated package manager
env - the environment
Returns:
a suitable doc writer, or null if format not supported.
Throws:
java.lang.IllegalArgumentException - an argument is erroneous.

getDocFile

public static java.io.File getDocFile(int format,
                                      java.lang.String moduleName,
                                      int moduleKind,
                                      PackageMgr packageMgr,
                                      CoopnEnv env)
Get the documentation file for a particular format, associated to a module.
Parameters:
format - the format of doc writer, one of the valid indexes of the array returned by supportedFormats
moduleName - the name of the module
moduleKind - the kind of the module
packageMgr - the associated package manager
env - the environment
Returns:
the file, or null if format not supported.
Throws:
java.lang.IllegalArgumentException - an argument is erroneous.

getIndexFile

public static java.io.File getIndexFile(int format,
                                        java.lang.String moduleName,
                                        int moduleKind,
                                        PackageMgr packageMgr,
                                        CoopnEnv env)
Get an index file for a particular format, associated to a module.
Parameters:
format - the format of doc writer, one of the valid indexes of the array returned by supportedFormats
moduleName - the name of the module
moduleKind - the kind of the module
packageMgr - the associated package manager
env - the environment
Returns:
the file, or null if format not supported.
Throws:
java.lang.IllegalArgumentException - an argument is erroneous.

getTocFile

public static java.io.File getTocFile(int format,
                                      java.lang.String moduleName,
                                      int moduleKind,
                                      PackageMgr packageMgr,
                                      CoopnEnv env)
Get a TOC file for a particular format, associated to a module.
Parameters:
format - the format of doc writer, one of the valid indexes of the array returned by supportedFormats
moduleName - the name of the module
moduleKind - the kind of the module
packageMgr - the associated package manager
env - the environment
Returns:
the file, or null if format not supported.
Throws:
java.lang.IllegalArgumentException - an argument is erroneous.

getGTocFile

public static java.io.File getGTocFile(int format,
                                       java.lang.String moduleName,
                                       int moduleKind,
                                       PackageMgr packageMgr,
                                       CoopnEnv env)
Get a general TOC file for a particular format, associated to a module.
Parameters:
format - the format of doc writer, one of the valid indexes of the array returned by supportedFormats
moduleName - the name of the module
moduleKind - the kind of the module
packageMgr - the associated package manager
env - the environment
Returns:
the file, or null if format not supported.
Throws:
java.lang.IllegalArgumentException - an argument is erroneous.

getDocWriter

public static DocWriter getDocWriter(int format,
                                     java.lang.String moduleName,
                                     int moduleKind,
                                     PackageMgr packageMgr,
                                     CoopnEnv env)
                              throws java.io.IOException
Get a documentation writer for a particular format, associated to a module.
Parameters:
format - the format of doc writer, one of the valid indexes of the array returned by supportedFormats
moduleName - the name of the module
moduleKind - the kind of the module
packageMgr - the associated package manager
env - the environment
Returns:
a suitable doc writer, or null if format not supported.
Throws:
java.lang.IllegalArgumentException - an argument is erroneous.
java.io.IOException - cannot open the file for the writer.

getIndexWriter

public static DocWriter getIndexWriter(int format,
                                       java.lang.String moduleName,
                                       int moduleKind,
                                       PackageMgr packageMgr,
                                       CoopnEnv env)
                                throws java.io.IOException
Get an index writer for a particular format, associated to a module.
Parameters:
format - the format of doc writer, one of the valid indexes of the array returned by supportedFormats
moduleName - the name of the module
moduleKind - the kind of the module
packageMgr - the associated package manager
env - the environment
Returns:
a suitable doc writer, or null if format not supported.
Throws:
java.lang.IllegalArgumentException - an argument is erroneous.
java.io.IOException - cannot open the file for the writer.

getTocWriter

public static DocWriter getTocWriter(int format,
                                     java.lang.String moduleName,
                                     int moduleKind,
                                     PackageMgr packageMgr,
                                     CoopnEnv env)
                              throws java.io.IOException
Get a TOC writer for a particular format, associated to a module.
Parameters:
format - the format of doc writer, one of the valid indexes of the array returned by supportedFormats
moduleName - the name of the module
moduleKind - the kind of the module
packageMgr - the associated package manager
env - the environment
Returns:
a suitable doc writer, or null if format not supported.
Throws:
java.lang.IllegalArgumentException - an argument is erroneous.
java.io.IOException - cannot open the file for the writer.

getGTocWriter

public static DocWriter getGTocWriter(int format,
                                      java.lang.String moduleName,
                                      int moduleKind,
                                      PackageMgr packageMgr,
                                      CoopnEnv env)
                               throws java.io.IOException
Get a general TOC writer for a particular format, associated to a module.
Parameters:
format - the format of doc writer, one of the valid indexes of the array returned by supportedFormats
moduleName - the name of the module
moduleKind - the kind of the module
packageMgr - the associated package manager
env - the environment
Returns:
a suitable doc writer, or null if format not supported.
Throws:
java.lang.IllegalArgumentException - an argument is erroneous.
java.io.IOException - cannot open the file for the writer.