org.weborganic.cobble
Class XMLGenerator

java.lang.Object
  extended by org.weborganic.cobble.XMLGenerator

public final class XMLGenerator
extends Object

Generates the documentation from code comments in XML-based languages (XSLT, Schematron)

Version:
20 December 2013
Author:
Christophe Lauret

Constructor Summary
XMLGenerator(File code)
          Sole constructor.
 
Method Summary
 void generate(File target)
          Generates the documentation to the specified file.
 void generate(OutputStream out)
          Generates the documentation onto an output stream.
 void generate(Result result)
          Generates the documentation.
 void generate(Writer out)
          Generates the documentation onto a writer.
 void generateSilent(File target)
          Generates the documentation to the specified file swallowing any occurring exception.
 void generateSilent(OutputStream out)
          Generates the documentation onto an output stream swallowing any occurring exception.
 void generateSilent(Writer out)
          Generates the documentation onto a writer swallowing any occurring exception.
 void includeXMLDeclaration(boolean yes)
           
static boolean isSupported(String path)
          Indicates whether documentation can be generated from the code denoted by the given file path.
 void setEncoding(String encoding)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLGenerator

public XMLGenerator(File code)
Sole constructor.

Parameters:
code - The file to the code to document.
Method Detail

setEncoding

public void setEncoding(String encoding)
Parameters:
encoding - the character encoding of the output XML.

includeXMLDeclaration

public void includeXMLDeclaration(boolean yes)
Parameters:
yes - true to include the XML declaration in the output false otherwise.

generate

public void generate(Result result)
              throws CobbleException
Generates the documentation.

Parameters:
result - Where the results go.
Throws:
CobbleException

generate

public void generate(OutputStream out)
              throws CobbleException
Generates the documentation onto an output stream.

Parameters:
out - The output where the documentation should be generated.
Throws:
CobbleException

generate

public void generate(Writer out)
              throws CobbleException
Generates the documentation onto a writer.

Parameters:
out - The writer where the documentation should be generated.
Throws:
CobbleException - Wraps any transform or I/O exception.

generate

public void generate(File target)
              throws CobbleException
Generates the documentation to the specified file.

Parameters:
target - The target file where the XML documentation should go.
Throws:
CobbleException - Wraps any transform or I/O exception.

generateSilent

public void generateSilent(OutputStream out)
Generates the documentation onto an output stream swallowing any occurring exception.

Parameters:
out - The output where the documentation should be generated.

generateSilent

public void generateSilent(Writer out)
Generates the documentation onto a writer swallowing any occurring exception.

Parameters:
out - The writer where the documentation should be generated.
Throws:
CobbleException - Wraps any transform or I/O exception.

generateSilent

public void generateSilent(File target)
Generates the documentation to the specified file swallowing any occurring exception.

Parameters:
target - The target file where the XML documentation should go.

isSupported

public static final boolean isSupported(String path)
Indicates whether documentation can be generated from the code denoted by the given file path.

Parameters:
path - The path within the model to the file containing the code to document.
Returns:
true is the file extension is ".xsl", ".xslt" or ".sch"; false.