|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mcdermottroe.exemplar.output.XMLParserGenerator<T>
com.mcdermottroe.exemplar.output.XMLParserSourceGenerator<Generator>
com.mcdermottroe.exemplar.output.java.binding.Generator
public class Generator
A class which generates data binding Java parsers.
| Field Summary | |
|---|---|
protected String |
basePackage
The base package, if any, where the output code is going to live. |
| Fields inherited from class com.mcdermottroe.exemplar.output.XMLParserSourceGenerator |
|---|
codeFragments, timestamp |
| Constructor Summary | |
|---|---|
|
Generator()
Creates a source generator which produces data binding parsers in the Java language. |
protected |
Generator(Map<String,String> code,
String time,
String pkg)
Copy constructor, see XMLParserSourceGenerator.XMLParserSourceGenerator(Map, String) for
details. |
| Method Summary | |
|---|---|
protected void |
createAbstractElementClass(File dir)
Create the abstract element class which is the root of all element classes. |
protected void |
createElementClass(XMLElement element,
File dir)
Create a class for a given element. |
protected void |
createProcessingInstructionClass(File dir)
Create the ProcessingInstruction class. |
protected void |
createRootParserClass(File dir)
Create the base parser class which can be used to parse the input. |
protected void |
createXMLComponentClass(File dir)
Create the XMLComponent class. |
protected void |
createXMLContentClass(File dir)
Create the XMLContent class. |
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 a parser and places the source (if any) in the given directory. |
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 |
| Field Detail |
|---|
protected String basePackage
| Constructor Detail |
|---|
public Generator()
throws XMLParserGeneratorException
XMLParserGeneratorException - if the super-class constructor
throws one.
protected Generator(Map<String,String> code,
String time,
String pkg)
XMLParserSourceGenerator.XMLParserSourceGenerator(Map, String) for
details.
code - The code fragments.time - The timestamp.pkg - The basePackage.| Method Detail |
|---|
public void generateParser(XMLDocumentType doctype,
File targetDirectory)
throws XMLParserGeneratorException
generateParser in class XMLParserSourceGenerator<Generator>doctype - The description of the vocabulary of
XML to generate a parser for.targetDirectory - The directory to place the source
(if any).
XMLParserGeneratorException - if an error occurs during code
generation. If the implementation
wishes to report any error it should
be via this mechanism.public String describeLanguage()
describeLanguage in class XMLParserGenerator<Generator>String that can be used in help messages and in
documentation to describe the language that this generator
outputs.public String describeAPI()
describeAPI in class XMLParserGenerator<Generator>String that can be used in help messages and in
documentation to describe the API that the generated code
implements.
protected void createRootParserClass(File dir)
throws XMLParserGeneratorException
dir - The directory in which the base
parser class will be put.
XMLParserGeneratorException - if the base parser class cannot be
created.
protected void createAbstractElementClass(File dir)
throws XMLParserGeneratorException
dir - The directory in which to place the
class.
XMLParserGeneratorException - if the abstract element class
cannot be generated.
protected void createElementClass(XMLElement element,
File dir)
throws XMLParserGeneratorException
element - The element to create the class
for.dir - The directory in which to create
the class.
XMLParserGeneratorException - if the abstract element class
cannot be generated.
protected void createXMLContentClass(File dir)
throws XMLParserGeneratorException
dir - The directory in which to create
the class.
XMLParserGeneratorException - if the XMLContent class cannot be
generated.
protected void createXMLComponentClass(File dir)
throws XMLParserGeneratorException
dir - The directory in which to create
the class.
XMLParserGeneratorException - if the XMLComponent class
cannot be generated.
protected void createProcessingInstructionClass(File dir)
throws XMLParserGeneratorException
dir - The directory in which to create
the class.
XMLParserGeneratorException - if the ProcessingInstruction class
cannot be generated.
public Generator getCopy()
throws CopyException
CopyException - if the copying encountered an exception.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||