doc.com.mcdermottroe.exemplar.manual
Class CreateManual

java.lang.Object
  extended by doc.com.mcdermottroe.exemplar.manual.CreateManual

public class CreateManual
extends Object

Creates the manual for Exemplar from the skeleton, human-readable(ish) DocBook sources. The majority of the content in the manual is generated from here. This class actually generates an XSLT stylesheet which transforms the non-generated sources into the final DocBook sources which are then transformed by yet more XSLT into the man(1) and XHTML formats.

Since:
0.1

Nested Class Summary
private static class CreateManual.CreateManualException
          The "error handling" in this mini-program is done by throwing one of these.
 
Constructor Summary
private CreateManual()
          Prevent this class from being instantiated.
 
Method Summary
private static String cmdsynopsisXSLT()
          Create the synopsis section of the manual.
private static String dateXSLT()
          Create the date section of the manual.
private static String escapeBasicXMLStuff(String unescaped)
          Escape characters that could cause trouble in XML, the characters escaped are ampersand, less-than and greater-than characters.
private static String exitcodesXSLT()
          Describe all of the exit codes used by the program.
static void main(String[] args)
          Create the manual.
private static String messagesXSLT()
          Describe all of the messages that can be output by the program.
private static String optionsdescriptionXSLT()
          Create the detailed description of every option that the program accepts.
private static String refmiscinfoXSLT()
          Create the refmiscinfo section of the manual.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateManual

private CreateManual()
Prevent this class from being instantiated.

Method Detail

main

public static void main(String[] args)
Create the manual.

Parameters:
args - It's a main(), here are the args.

dateXSLT

private static String dateXSLT()
Create the date section of the manual.

Returns:
A String containing XSLT to transform the element with the id "date" into a valid date section.

refmiscinfoXSLT

private static String refmiscinfoXSLT()
Create the refmiscinfo section of the manual.

Returns:
A String containing XSLT to transform the element with the id "refmiscinfo" into a valid refmiscinfo section.

cmdsynopsisXSLT

private static String cmdsynopsisXSLT()
Create the synopsis section of the manual.

Returns:
A String containing XSLT to transform the element with the id "cmdsynopsis" into the DocBook XML form of the synopsis line in the manual.

optionsdescriptionXSLT

private static String optionsdescriptionXSLT()
                                      throws ParseException
Create the detailed description of every option that the program accepts.

Returns:
A String containing the XSLT to transform the element with the id "optionsdescription" into the detailed description of every option that the program accepts.
Throws:
ParseException - if any malformed XML references have been found.

exitcodesXSLT

private static String exitcodesXSLT()
Describe all of the exit codes used by the program.

Returns:
A String containing the XSLT to transform the element with the id "exitcodes" into the description of the exit codes used by the program.

messagesXSLT

private static String messagesXSLT()
Describe all of the messages that can be output by the program.

Returns:
A String containing the XSLT to transform the element with the id "messages" into the description of the messages that.

escapeBasicXMLStuff

private static String escapeBasicXMLStuff(String unescaped)
Escape characters that could cause trouble in XML, the characters escaped are ampersand, less-than and greater-than characters.

Parameters:
unescaped - The String to be escaped.
Returns:
The String unescaped with all ampersand, less-than and greater-than characters escaped to their XML entity forms.