| java.lang.Object org.xml.sax.helpers.DefaultHandler jimm.datavision.testdata.SchemaGen
All known Subclasses: jimm.datavision.testdata.postgres.PostgreSQLSchemaGen, jimm.datavision.testdata.oracle.OracleSchemaGen, jimm.datavision.testdata.mysql.MySQLSchemaGen,
SchemaGen | abstract public class SchemaGen extends DefaultHandler (Code) | | Skeleton for creating a schema.sql file by reading an XML description
of a schema.
author: Jim Menard, jimm@io.com |
Method Summary | |
protected void | column(Attributes attributes) Parses a column XML tag and calls printColumn . | public void | endElement(String namespaceURI, String localName, String qName) | abstract protected void | endTable() Outputs the SQL needed to close a create table statement. | abstract protected void | makeTable(String tableName) Outputs the SQL needed to create a database table. | protected void | printColumn(String columnName, String type, int size, boolean notNull, boolean primaryKey) Prints the SQL needed to create a database column within a create table
statement. | protected void | printColumnName(String columnName) Prints the column name, taking into account case, blanks, and other
possibly funky things. | abstract protected void | printNotNull() Prints the SQL that defines a column as NOT NULL. | abstract protected void | printPrimaryKey() Prints the SQL that defines a column as a primary key. | abstract protected void | printType(String type, int size) Prints the SQL that defines a column's type. | protected String | printableName(String name) | public void | run(String schemaXMLFile) | public void | startElement(String namespaceURI, String localName, String qName, Attributes attributes) | protected void | table(Attributes attributes) Parses a table XML tag and calls makeTable . |
isFirstColumn | protected boolean isFirstColumn(Code) | | |
notNull | protected boolean notNull(Code) | | |
primaryKey | protected boolean primaryKey(Code) | | |
column | protected void column(Attributes attributes)(Code) | | Parses a column XML tag and calls printColumn . Also handles
commas and indentation.
Parameters: attributes - XML element attributes See Also: SchemaGen.makeTable |
endTable | abstract protected void endTable()(Code) | | Outputs the SQL needed to close a create table statement.
|
makeTable | abstract protected void makeTable(String tableName)(Code) | | Outputs the SQL needed to create a database table. Optionally prints
the SQL needed to destroy the table first.
|
printColumn | protected void printColumn(String columnName, String type, int size, boolean notNull, boolean primaryKey)(Code) | | Prints the SQL needed to create a database column within a create table
statement.
|
printColumnName | protected void printColumnName(String columnName)(Code) | | Prints the column name, taking into account case, blanks, and other
possibly funky things.
|
printNotNull | abstract protected void printNotNull()(Code) | | Prints the SQL that defines a column as NOT NULL.
|
printPrimaryKey | abstract protected void printPrimaryKey()(Code) | | Prints the SQL that defines a column as a primary key.
|
printType | abstract protected void printType(String type, int size)(Code) | | Prints the SQL that defines a column's type.
|
table | protected void table(Attributes attributes)(Code) | | Parses a table XML tag and calls makeTable .
Parameters: attributes - XML element attributes See Also: SchemaGen.makeTable |
Methods inherited from org.xml.sax.helpers.DefaultHandler | public void characters(char ch, int start, int length) throws SAXException(Code)(Java Doc) public void endDocument() throws SAXException(Code)(Java Doc) public void endElement(String uri, String localName, String qName) throws SAXException(Code)(Java Doc) public void endPrefixMapping(String prefix) throws SAXException(Code)(Java Doc) public void error(SAXParseException e) throws SAXException(Code)(Java Doc) public void fatalError(SAXParseException e) throws SAXException(Code)(Java Doc) public void ignorableWhitespace(char ch, int start, int length) throws SAXException(Code)(Java Doc) public void notationDecl(String name, String publicId, String systemId) throws SAXException(Code)(Java Doc) public void processingInstruction(String target, String data) throws SAXException(Code)(Java Doc) public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException(Code)(Java Doc) public void setDocumentLocator(Locator locator)(Code)(Java Doc) public void skippedEntity(String name) throws SAXException(Code)(Java Doc) public void startDocument() throws SAXException(Code)(Java Doc) public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException(Code)(Java Doc) public void startPrefixMapping(String prefix, String uri) throws SAXException(Code)(Java Doc) public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException(Code)(Java Doc) public void warning(SAXParseException e) throws SAXException(Code)(Java Doc)
|
|
|