|
||||||||||
| 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.dtd.Generator
public class Generator
A class which generates a DTD for this XML vocabulary.
| Field Summary |
|---|
| Fields inherited from class com.mcdermottroe.exemplar.output.XMLParserSourceGenerator |
|---|
codeFragments, timestamp |
| Constructor Summary | |
|---|---|
|
Generator()
Creates a source generator that produces DTDs. |
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 DTD and places it in the given file. |
Generator |
getCopy()
Creates a deep copy of the current object and returns it. |
private static String |
objectTreeToContentSpec(Object o)
Convert either an XMLSequence or XMLAlternative to a
contentspec portion of an element declaration. |
| 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 |
|---|
public Generator()
throws XMLParserGeneratorException
XMLParserGeneratorException - if the super-class constructor
throws one.
protected Generator(Map<String,String> code,
String time)
XMLParserSourceGenerator.XMLParserSourceGenerator(Map, String) for
details.
code - The code fragments.time - The timestamp.| 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 in which to place the
source.
XMLParserGeneratorException - if the code fragments could not be
loaded or if the output file could
not be written to.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.private static String objectTreeToContentSpec(Object o)
XMLSequence or XMLAlternative to a
contentspec portion of an element declaration.
o - An XMLObject or String which is part of a
contentspec declaration. If the object is a String
it must be an element name, otherwise it should be an
XMLAlternative or an XMLSequence.
String representation of the contentspec.
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 | |||||||||