|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.echo.binding.JDOMetaDataGenerator
public class JDOMetaDataGenerator
A JDO meta-data generator. This is a generic generator that does not apply any JDO vendor specific extensions. Sub-classes may be developed that apply vendor specific extensions.
Copyright 2006 Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
protected Map<String,String> |
fields
The fields available in the class for which meta-data is to be generated. |
protected String |
name
The name of the class for which the meta-data is to be generated. |
protected String |
packageName
The name of the package to which the class belongs. |
| Constructor Summary | |
|---|---|
protected |
JDOMetaDataGenerator()
Default constructor. |
|
JDOMetaDataGenerator(String name,
String packageName,
Map<String,String> fields)
Create a new instance of the class using the specified values. |
| Method Summary | |
|---|---|
protected org.jdom.Element |
fetchEchoPackage(org.jdom.Document document)
Fetch the element (if it exists) for the package definition for com.sptci.echo. |
protected org.jdom.Element |
fetchListItem(org.jdom.Document document)
Fetch the element (if it exists) for the class definition for com.sptci.echo.ListItem. |
protected org.jdom.Element |
fetchSource(org.jdom.Document document)
Fetch the element (if it exists) that represents the class representing name. |
protected org.jdom.Element |
fetchSourcePackage(org.jdom.Document document)
Fetch the element (if it exists) for the package definition for packageName. |
void |
generate()
Generate the JDO meta-data file for a JDO JavaBean. |
protected org.jdom.Element |
generateEchoPackage()
Generate the meta-data elements and attributes for the com.sptci.echo package. |
protected void |
generateFile(File file)
Generate a new meta-data file with the meta-data for the name JDO object. |
protected org.jdom.Element |
generateListItem()
Generate the meta-data for the ListItem class. |
protected org.jdom.Element |
generateMetaData()
Generate the meta-data elements and attributes for the JDO object represented by name. |
protected org.jdom.Element |
generateSource()
Generate the element for the class represented by name. |
protected org.jdom.Element |
generateSourcePackage()
Generate the package ( packageName) element for the class
represented by name. |
protected void |
updateFile(File file)
Add the meta-data for the name JDO object to the
existing meta-data file. |
protected void |
writeFile(File file,
org.jdom.Document document)
Write the specified XML document to the specified file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String name
protected String packageName
protected Map<String,String> fields
| Constructor Detail |
|---|
protected JDOMetaDataGenerator()
public JDOMetaDataGenerator(String name,
String packageName,
Map<String,String> fields)
name - The name value to set.packageName - The packageName value to set.fields - The fields value to set.| Method Detail |
|---|
public void generate()
throws org.jdom.JDOMException,
IOException
Uses JDOM and Jaxen for parsing an existing meta-data file and for creating or updating the file.
org.jdom.JDOMException - If errors are encountered while fetching
the element.
IOException - If errors are encountered while writing to
the meta-data file.updateFile(java.io.File),
generateFile(java.io.File)
protected void generateFile(File file)
throws org.jdom.JDOMException,
IOException
name JDO object.
file - The file to generate
org.jdom.JDOMException - If errors are encountered while fetching
the element.
IOException - If errors are encountered while writing to
the meta-data file.writeFile(java.io.File, org.jdom.Document)protected org.jdom.Element generateMetaData()
name.
generateSourcePackage(),
generateSource()protected org.jdom.Element generateSourcePackage()
packageName) element for the class
represented by name.
protected org.jdom.Element generateSource()
name.
protected org.jdom.Element generateEchoPackage()
com.sptci.echo package.
generateListItem()
protected void writeFile(File file,
org.jdom.Document document)
throws org.jdom.JDOMException,
IOException
file - The file to write to.document - The document to write.
org.jdom.JDOMException - If errors are encountered while fetching
the element.
IOException - If errors are encountered while writing to
the meta-data file.
protected void updateFile(File file)
throws org.jdom.JDOMException,
IOException
name JDO object to the
existing meta-data file.
file - The file to update.
org.jdom.JDOMException - If errors are encountered while fetching
the element.
IOException - If errors are encountered while writing to
the meta-data file.fetchSourcePackage(org.jdom.Document),
generateMetaData(),
fetchSource(org.jdom.Document),
generateSource(),
fetchEchoPackage(org.jdom.Document),
fetchListItem(org.jdom.Document),
generateEchoPackage(),
generateListItem(),
writeFile(java.io.File, org.jdom.Document)
protected org.jdom.Element fetchSourcePackage(org.jdom.Document document)
throws org.jdom.JDOMException
packageName.
document - The document from which to fetch the element.
org.jdom.JDOMException - If errors are encountered while fetching
the element.
protected org.jdom.Element fetchSource(org.jdom.Document document)
throws org.jdom.JDOMException
name.
document - The document from which to fetch the element.
org.jdom.JDOMException - If errors are encountered while fetching
the element.
protected org.jdom.Element fetchEchoPackage(org.jdom.Document document)
throws org.jdom.JDOMException
com.sptci.echo.
document - The document from which to fetch the element.
org.jdom.JDOMException - If errors are encountered while fetching
the element.
protected org.jdom.Element fetchListItem(org.jdom.Document document)
throws org.jdom.JDOMException
com.sptci.echo.ListItem.
document - The document from which to fetch the element.
org.jdom.JDOMException - If errors are encountered while fetching
the element.protected org.jdom.Element generateListItem()
ListItem class.
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||