|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mcdermottroe.exemplar.output.OutputUtils
public final class OutputUtils
Output handling utility methods.
| Constructor Summary | |
|---|---|
private |
OutputUtils()
Private constructor to prevent instantiation of this class. |
| Method Summary | |
|---|---|
static SortedSet<LanguageAPIPair> |
availableLanguageAPIPairs()
Discover the set of output language-API pairs that are legal. |
static SortedMap<String,String> |
availableOutputAPIs()
Discover the available output APIs. |
static SortedMap<String,String> |
availableOutputLanguages()
Discover the available output languages. |
static void |
generateParser(XMLDocumentType doctype,
String filename,
String language,
String api)
Generate a parser given an XMLDocumentType and the type of
parser that is required. |
static void |
writeStringToFile(String s,
File file)
Write a String to a File. |
static void |
writeStringToFile(String s,
File dir,
String filename)
Write a String to a file. |
static void |
writeStringToFile(String s,
String file)
Write a String to a file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
private OutputUtils()
| Method Detail |
|---|
public static void generateParser(XMLDocumentType doctype,
String filename,
String language,
String api)
throws OutputException
XMLDocumentType and the type of
parser that is required.
doctype - The XMLDocumentType describing the
vocabulary.filename - The name of the file to output to (directory
name for multi file output).language - The language of the parser to be output.api - The API (if any) that the parser to be output
must conform to.
OutputException - if any of the required parameters are null, if
the generator cannot be instantiated or if the
generator throws an exception while trying to
generate code.
public static void writeStringToFile(String s,
String file)
throws OutputException
String to a file.
s - The String to write to the file.file - A String containing the full path to the
file to write to.
OutputException - if anything goes wrong
public static void writeStringToFile(String s,
File dir,
String filename)
throws OutputException
String to a file.
s - The String to write to the file.dir - A File for the directory in which the
new file will reside.filename - A String containing the name of the file
in dir to write the String
to.
OutputException - if anything goes wrong
public static void writeStringToFile(String s,
File file)
throws OutputException
String to a File.
s - The String to write to the File.file - The File to write the String
to.
OutputException - if anything goes wrong.public static SortedMap<String,String> availableOutputLanguages()
SortedMap where the keys are the available output
languages and the values are the descriptions of those output
languages.public static SortedMap<String,String> availableOutputAPIs()
SortedMap where the keys are the available output
APIs and the values are the descriptions of those output APIs.public static SortedSet<LanguageAPIPair> availableLanguageAPIPairs()
SortedSet containing a LanguageAPIPair for
every legal combination of language and API.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||