DTDDoc
Class DTDCommenter

java.lang.Object
  extended by DTDDoc.DTDCommenter

public class DTDCommenter
extends java.lang.Object

Main class to the DTDDoc program, everything happen here.

Author:
Stefan Champailler

Field Summary
static java.lang.String ATTR_COMMENT_TAG
          Tag starting an attribute comment (@attr attributeName comment)
static char BEGIN_TAG
          Character used to begin a tag.
static char CODE_SEPARATOR
          Character used to mark the beginning and the end of a part of a code fragment.
static char CODE_SEPARATOR_DEPRECATED
          Character used to mark the beginning and the end of a part of code fragment.
static java.lang.String COMMENT_TAG
          Tag starting a comment (@comment)
static java.lang.String DOCTYPE_TAG
          Tag starting a DTD doctype defintion (@doctype)
static java.lang.String EXAMPLE_TAG
          Tag starting an "example" comment (@example)
static java.lang.String FIXME_TAG
          Tag starting a "fix me" comment (@fixme)
static java.lang.String HIDDEN_TAG
          Tag starting a "hidden" comment (@hidden)
static java.lang.String ROOT_TAG
          Tag starting a root element defintion (@root)
static java.lang.String TITLE_TAG
          Tag starting a DTD title defintion (@title)
static java.lang.String VERSION
          Version of DTDDoc running
 
Constructor Summary
DTDCommenter()
          Deprecated. maintained for binary backward compatibility: uses SystemLogger as default logging system.
DTDCommenter(Logger log)
           
 
Method Summary
 char cardinalToChar(com.wutka.dtd.DTDCardinal cardinal)
           
 void commentDTDs(java.util.HashSet scan, java.io.File sourceDir, java.io.File destDir, boolean showHiddenTags, boolean showFixmeTags, java.lang.String docTitle, java.io.File styleSheet)
          Deprecated. signature maintained for binary backward compatibility with versions <= 0.0.11, but equivalent to the other more generic commentDTDs() method
 void commentDTDs(java.util.Set scan, java.io.File sourceDir, java.io.File destDir, boolean showHiddenTags, boolean showFixmeTags, boolean getAroundNetBeanComments, java.lang.String docTitle, java.io.File styleSheet)
          This is the main method.
 java.lang.String getDTDBaseURI(ExtendedDTD dtd)
           
 java.lang.String getExternalHREF(ExtendedDTD dtd, com.wutka.dtd.DTDElement element, java.lang.String text)
          Builds a HTML external reference to an element from the documentation of a DTD (filename#element_id).
 java.lang.String getExternalHREF(ExtendedDTD dtd, java.lang.String elementName, java.lang.String text)
           
 java.lang.String getInternalHREF(ExtendedDTD dtd, com.wutka.dtd.DTDElement element)
          Builds a HTML internal reference to an element inside the documentation of a DTD (#element_id).
 void makeTOC(java.util.Set dtds, java.lang.String docTitle)
          This function will create a table of content for the parsed DTDs documentation, and copy necessary images (img sub-directory) and JavaScript library.
 java.net.URI newURITo(ExtendedDTD dtd)
           
 java.net.URI newURITo(ExtendedDTD dtd, com.wutka.dtd.DTDAttlist list, com.wutka.dtd.DTDAttribute attribute)
           
 java.net.URI newURITo(ExtendedDTD dtd, com.wutka.dtd.DTDElement element)
           
 java.net.URI newURITo(ExtendedDTD dtd, com.wutka.dtd.DTDElement element, com.wutka.dtd.DTDAttribute attribute)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Version of DTDDoc running


BEGIN_TAG

public static final char BEGIN_TAG
Character used to begin a tag. Usually @.

See Also:
Constant Field Values

COMMENT_TAG

public static final java.lang.String COMMENT_TAG
Tag starting a comment (@comment)

See Also:
Constant Field Values

ATTR_COMMENT_TAG

public static final java.lang.String ATTR_COMMENT_TAG
Tag starting an attribute comment (@attr attributeName comment)

See Also:
Constant Field Values

FIXME_TAG

public static final java.lang.String FIXME_TAG
Tag starting a "fix me" comment (@fixme)

See Also:
Constant Field Values

EXAMPLE_TAG

public static final java.lang.String EXAMPLE_TAG
Tag starting an "example" comment (@example)

See Also:
Constant Field Values

HIDDEN_TAG

public static final java.lang.String HIDDEN_TAG
Tag starting a "hidden" comment (@hidden)

See Also:
Constant Field Values

ROOT_TAG

public static final java.lang.String ROOT_TAG
Tag starting a root element defintion (@root)

See Also:
Constant Field Values

TITLE_TAG

public static final java.lang.String TITLE_TAG
Tag starting a DTD title defintion (@title)

See Also:
Constant Field Values

DOCTYPE_TAG

public static final java.lang.String DOCTYPE_TAG
Tag starting a DTD doctype defintion (@doctype)

See Also:
Constant Field Values

CODE_SEPARATOR_DEPRECATED

public static final char CODE_SEPARATOR_DEPRECATED
Character used to mark the beginning and the end of a part of code fragment. This one (§) is deprecated because it is not an ASCII one (it's ISO-8859-1). Therefore it's not compatible between different charsets (only the first 128 are). It was a mistake...

See Also:
Constant Field Values

CODE_SEPARATOR

public static final char CODE_SEPARATOR
Character used to mark the beginning and the end of a part of a code fragment. This one is ASCII and is to be preferred.

See Also:
Constant Field Values
Constructor Detail

DTDCommenter

public DTDCommenter()
Deprecated. maintained for binary backward compatibility: uses SystemLogger as default logging system.


DTDCommenter

public DTDCommenter(Logger log)
Method Detail

getInternalHREF

public java.lang.String getInternalHREF(ExtendedDTD dtd,
                                        com.wutka.dtd.DTDElement element)
Builds a HTML internal reference to an element inside the documentation of a DTD (#element_id).

Parameters:
dtd - the target DTD (current, since it is an internal reference).
element - The element to reference.
Returns:
A string containing the HTML code of the reference: <a href='#element_id'>element name</a>

getExternalHREF

public java.lang.String getExternalHREF(ExtendedDTD dtd,
                                        com.wutka.dtd.DTDElement element,
                                        java.lang.String text)
                                 throws java.io.IOException
Builds a HTML external reference to an element from the documentation of a DTD (filename#element_id).

Parameters:
dtd - the target DTD.
element - The element to reference.
text - text that will appear in the reference.
Returns:
A string containing the HTML code of the reference: <a href='dtd_reference#element_id'>text</a>
Throws:
java.io.IOException

getExternalHREF

public java.lang.String getExternalHREF(ExtendedDTD dtd,
                                        java.lang.String elementName,
                                        java.lang.String text)
                                 throws java.io.IOException
Throws:
java.io.IOException

getDTDBaseURI

public java.lang.String getDTDBaseURI(ExtendedDTD dtd)

newURITo

public java.net.URI newURITo(ExtendedDTD dtd)

newURITo

public java.net.URI newURITo(ExtendedDTD dtd,
                             com.wutka.dtd.DTDElement element)

newURITo

public java.net.URI newURITo(ExtendedDTD dtd,
                             com.wutka.dtd.DTDAttlist list,
                             com.wutka.dtd.DTDAttribute attribute)

newURITo

public java.net.URI newURITo(ExtendedDTD dtd,
                             com.wutka.dtd.DTDElement element,
                             com.wutka.dtd.DTDAttribute attribute)

cardinalToChar

public char cardinalToChar(com.wutka.dtd.DTDCardinal cardinal)

makeTOC

public void makeTOC(java.util.Set dtds,
                    java.lang.String docTitle)
             throws java.io.IOException
This function will create a table of content for the parsed DTDs documentation, and copy necessary images (img sub-directory) and JavaScript library.

The TOC will be created in a separate HTML file (toc.html) so that it can be used in a frame-structured page.

Parameters:
docTitle - the title to put at the top of the table.
dtds - the DTD's to make the table of content for.
Throws:
java.io.IOException

commentDTDs

public void commentDTDs(java.util.HashSet scan,
                        java.io.File sourceDir,
                        java.io.File destDir,
                        boolean showHiddenTags,
                        boolean showFixmeTags,
                        java.lang.String docTitle,
                        java.io.File styleSheet)
                 throws java.io.IOException,
                        java.lang.Exception
Deprecated. signature maintained for binary backward compatibility with versions <= 0.0.11, but equivalent to the other more generic commentDTDs() method

Throws:
java.io.IOException
java.lang.Exception

commentDTDs

public void commentDTDs(java.util.Set scan,
                        java.io.File sourceDir,
                        java.io.File destDir,
                        boolean showHiddenTags,
                        boolean showFixmeTags,
                        boolean getAroundNetBeanComments,
                        java.lang.String docTitle,
                        java.io.File styleSheet)
                 throws java.io.IOException
This is the main method. It chains the following tasks:
  1. parse the DTDs
  2. make the documentation for each one
  3. make the index page (the main frameset, or main page if frames are not supported)
  4. make the introduction page (in the frame on the right)
  5. make the TOC (frame on the left)
  6. copy the stylesheet and other resources (images and JavaScript)
  7. make the element index

Parameters:
scan - the DTD files to analyze
sourceDir - the base directory for relative path computations
destDir - the destination directory to store the generated documentation
showHiddenTags - tells if the content of the @hidden tags must be part of the documentation
showFixmeTags - tells if the content of the @fixme tags must be part of the documentation
getAroundNetBeanComments - in case you have comments that start with three hyphens, this option will tell DTDDoc to interpret them as regular double hyphens. This was introduced to support NetBeans comments.
docTitle - name of the documentation: it will appear at the top of the index.
styleSheet - the stylesheet to use to render the documentation: it will be copied into the documentation. If null, a default stylesheet is used.
Throws:
java.io.IOException - in case of an error while reading the DTDs or writing the documentation


Copyright © 2002-2008 DTDDoc. All Rights Reserved.