com.mcdermottroe.exemplar.output.xslt
Class Generator

java.lang.Object
  extended by com.mcdermottroe.exemplar.output.XMLParserGenerator<T>
      extended by com.mcdermottroe.exemplar.output.XMLParserSourceGenerator<Generator>
          extended by com.mcdermottroe.exemplar.output.xslt.Generator
All Implemented Interfaces:
Copyable<Generator>, Comparable<Generator>

public class Generator
extends XMLParserSourceGenerator<Generator>

A class which generates skeleton XSLT for this XML vocabulary.

Since:
0.1

Field Summary
 
Fields inherited from class com.mcdermottroe.exemplar.output.XMLParserSourceGenerator
codeFragments, timestamp
 
Constructor Summary
  Generator()
          Override the default constructor to add throws clause.
protected Generator(Map<String,String> code, String time)
          Copy constructor, see XMLParserSourceGenerator.XMLParserSourceGenerator(Map, String) for details.
 
Method Summary
 String describeAPI()
          Describe the API that the generated code implements/conforms to.
 String describeLanguage()
          Describe the language that this generator outputs in.
 void generateParser(XMLDocumentType doctype, File targetDirectory)
          Generates the XSLT and places it in the given file.
 Generator getCopy()
          Creates a deep copy of the current object and returns it.
 
Methods inherited from class com.mcdermottroe.exemplar.output.XMLParserSourceGenerator
compareTo, create, getCodeFragments, getSourceDirectory, getTimestamp, loadCodeFragment
 
Methods inherited from class com.mcdermottroe.exemplar.output.XMLParserGenerator
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Generator

public Generator()
          throws XMLParserGeneratorException
Override the default constructor to add throws clause.

Throws:
XMLParserGeneratorException - if the superclass constructor throws it.

Generator

protected Generator(Map<String,String> code,
                    String time)
Copy constructor, see XMLParserSourceGenerator.XMLParserSourceGenerator(Map, String) for details.

Parameters:
code - The code fragments.
time - The timestamp.
Method Detail

generateParser

public void generateParser(XMLDocumentType doctype,
                           File targetDirectory)
                    throws XMLParserGeneratorException
Generates the XSLT and places it in the given file.

Specified by:
generateParser in class XMLParserSourceGenerator<Generator>
Parameters:
doctype - The description of the vocabulary of XML to generate a parser for.
targetDirectory - The directory in which to place the generated source.
Throws:
XMLParserGeneratorException - if the code fragments cannot be loaded from the backing store, or if the output file cannot be written to.

describeLanguage

public String describeLanguage()
Describe the language that this generator outputs in.

Specified by:
describeLanguage in class XMLParserGenerator<Generator>
Returns:
A String that can be used in help messages and in documentation to describe the language that this generator outputs.

describeAPI

public String describeAPI()
Describe the API that the generated code implements/conforms to.

Specified by:
describeAPI in class XMLParserGenerator<Generator>
Returns:
A String that can be used in help messages and in documentation to describe the API that the generated code implements.

getCopy

public Generator getCopy()
                  throws CopyException
Creates a deep copy of the current object and returns it.

Returns:
A deep copy of the current object.
Throws:
CopyException - if the copying encountered an exception.