.DTD in the current dir.
- Since:
- 1/18/2000
Constructor Summary |
ExportDTD(JDBCClient client)
This constructor is used when a JDBCClient connection has already been established. |
ExportDTD(java.lang.String DB_URI,
java.lang.String username,
java.lang.String password)
This constructor is used when you need to create a new JDBCClient object
to establishes the connection with the database server. |
Method Summary |
void |
chooseDTD()
The method chooseDTD() sets the currentDTD name from the DTD URI. |
protected void |
closeOut()
The method closeOut() closes the instance variable 'out' of type BufferedWriter. |
void |
create(java.lang.String uri)
The method create() iterates through the ALL_DTDS_DTDM_Item relational table and
dispatches appropriate item type handler and attribute handler if necessary
for the item type. |
protected void |
createOut()
The method createOut() creates the BufferedWriter and set the instance
variable 'out' to be the new BufferedWriter. |
protected void |
handleATTLIST(java.lang.String id)
The method handleATTLIST iterates through the DTDM_Attribute relational
table for the given Item 'id' and writes the list of attribute for the
given Item |
protected void |
handleELEMENT_ANY()
The method handleELEMENT_ANY() writes the constant string 'ANY'. |
protected void |
handleELEMENT_ELEMENT(java.lang.String id)
The method handleELEMENT_ELEMENT() iterates through the ALL_DTDS_DTDM_Nesting
relational table and writes the element name if it is a simple
type, otherwise calls itself to handle the complex child. |
protected void |
handleELEMENT_EMPTY()
The method handleELEMENT_EMPTY() writes the constant string 'EMPTY'. |
protected void |
handleELEMENT_MIXED(java.lang.String id)
The method handleELEMENT_MIXED iterates through the ALL_DTDS_DTDM_Nesting
relational table and writes the element name of each simple item type. |
protected void |
handleELEMENT_PCDATA()
The method handleELEMENT_PCDATA writes the constant string '(#PCDATA)'. |
protected java.lang.String |
Indicator(java.lang.String s1,
java.lang.String s2)
The method Indicator() returns the appropriate constant string depending on
the fields: ratio and optional of the appropriate ALL_DTDS_DTDM_Nesting tuple |
void |
listDTDs()
The method listDTDs() returns the list of DTDs stored |
protected void |
writeFile(java.lang.String s)
The method writeFile just writes a string to the file. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
client_connection
JDBCClient client_connection
out
java.io.BufferedWriter out
rs
java.sql.ResultSet rs
isFirst
boolean isFirst
currentDTDURI
java.lang.String currentDTDURI
currentDTD
java.lang.String currentDTD
DTDM_item
java.lang.String DTDM_item
DTDM_Attribute
java.lang.String DTDM_Attribute
DTDM_Nesting
java.lang.String DTDM_Nesting
ExportDTD
public ExportDTD(JDBCClient client)
- This constructor is used when a JDBCClient connection has already been established.
- Parameters:
client
- JDBCClient connection to database
ExportDTD
public ExportDTD(java.lang.String DB_URI,
java.lang.String username,
java.lang.String password)
- This constructor is used when you need to create a new JDBCClient object
to establishes the connection with the database server.
- Parameters:
DB_URI
- String location of the serverusername
- String username to the serverpassword
- String password for the user name
closeOut
protected void closeOut()
- The method closeOut() closes the instance variable 'out' of type BufferedWriter.
chooseDTD
public void chooseDTD()
- The method chooseDTD() sets the currentDTD name from the DTD URI.
create
public void create(java.lang.String uri)
- The method create() iterates through the ALL_DTDS_DTDM_Item relational table and
dispatches appropriate item type handler and attribute handler if necessary
for the item type. It ultimately recreates the DTD requested by the URI
- Parameters:
uri
- String DTD requested for recreate
createOut
protected void createOut()
- The method createOut() creates the BufferedWriter and set the instance
variable 'out' to be the new BufferedWriter.
handleATTLIST
protected void handleATTLIST(java.lang.String id)
- The method handleATTLIST iterates through the DTDM_Attribute relational
table for the given Item 'id' and writes the list of attribute for the
given Item
- Parameters:
id
- String the id of the currrent defining element
handleELEMENT_ANY
protected void handleELEMENT_ANY()
- The method handleELEMENT_ANY() writes the constant string 'ANY'.
handleELEMENT_ELEMENT
protected void handleELEMENT_ELEMENT(java.lang.String id)
- The method handleELEMENT_ELEMENT() iterates through the ALL_DTDS_DTDM_Nesting
relational table and writes the element name if it is a simple
type, otherwise calls itself to handle the complex child.
- Parameters:
id
- String the id of the currrent defining element
handleELEMENT_EMPTY
protected void handleELEMENT_EMPTY()
- The method handleELEMENT_EMPTY() writes the constant string 'EMPTY'.
handleELEMENT_MIXED
protected void handleELEMENT_MIXED(java.lang.String id)
- The method handleELEMENT_MIXED iterates through the ALL_DTDS_DTDM_Nesting
relational table and writes the element name of each simple item type.
- Parameters:
id
- String the id of the current defining element
handleELEMENT_PCDATA
protected void handleELEMENT_PCDATA()
- The method handleELEMENT_PCDATA writes the constant string '(#PCDATA)'.
Indicator
protected java.lang.String Indicator(java.lang.String s1,
java.lang.String s2)
- The method Indicator() returns the appropriate constant string depending on
the fields: ratio and optional of the appropriate ALL_DTDS_DTDM_Nesting tuple
- Parameters:
s1
- multiples2
- optional- Returns:
- return a constant string
listDTDs
public void listDTDs()
- The method listDTDs() returns the list of DTDs stored
writeFile
protected void writeFile(java.lang.String s)
- The method writeFile just writes a string to the file.
- Parameters:
s
- String the string that will be written to the out file