All Packages Class Hierarchy This Package Previous Next Index
Class de.tudarmstadt.ito.xmldbms.mapfactories.MapFactory_MapDocument
java.lang.Object
|
+----de.tudarmstadt.ito.xmldbms.mapfactories.MapFactory_MapDocument
- public class MapFactory_MapDocument
- extends Object
- implements DocumentHandler
Create a Map from a mapping document.
MapFactory_MapDocument assumes that the mapping document is valid. If
it is not, the class will either generate garbage or throw an error. One
way to guarantee that the document is valid is to pass a validating parser
to the map factory.
For example, the following code creates a map from the sales.map
mapping document.
// Instantiate a new map factory from a database connection
// and a SAX parser.
factory = new MapFactory_MapDocument(conn, parser);
// Create a Map from sales.map.
map = factory.createMap(new InputSource(new FileReader("sales.map")));
// Pass the Map to DOMToDBMS.
domToDBMS = new DOMToDBMS(map);
- Version:
- 1.01
- Author:
- Ronald Bourret, Technical University of Darmstadt
-
MapFactory_MapDocument()
- Construct a new MapFactory_MapDocument.
-
MapFactory_MapDocument(Connection, Parser)
- Construct a new MapFactory_MapDocument and set the database connection
and SAX parser.
-
MapFactory_MapDocument(Connection, ResultSet, Parser)
- Construct a new MapFactory_MapDocument and set the database connection,
SAX parser, and result set.
-
characters(char[], int, int)
- Implementation of characters in SAX' DocumentHandler interface.
-
createMap(Connection, ResultSet, Parser, InputSource)
- Set the connection, mapped result set (if any), and SAX parser, then
create a map from a mapping document.
-
createMap(InputSource)
- Create a map from a mapping document.
-
endDocument()
- Implementation of endDocument in SAX' DocumentHandler interface.
-
endElement(String)
- Implementation of endElement in SAX' DocumentHandler interface.
-
getConnection()
- Get the current Connection.
-
getParser()
- Get the current SAX Parser.
-
getResultSet()
- Get the current ResultSet.
-
ignorableWhitespace(char[], int, int)
- Implementation of ignorableWhitespace in SAX' DocumentHandler interface.
-
processingInstruction(String, String)
- Implementation of processingInstruction in SAX' DocumentHandler interface.
-
setConnection(Connection)
- Set the current Connection.
-
setDocumentLocator(Locator)
- Implementation of setDocumentLocator in SAX' DocumentHandler interface.
-
setParser(Parser)
- Set the current SAX Parser.
-
setResultSet(ResultSet)
- Set the current ResultSet.
-
startDocument()
- Implementation of startDocument in SAX' DocumentHandler interface.
-
startElement(String, AttributeList)
- Implementation of startElement in SAX' DocumentHandler interface.
MapFactory_MapDocument
public MapFactory_MapDocument()
- Construct a new MapFactory_MapDocument.
MapFactory_MapDocument
public MapFactory_MapDocument(Connection conn,
Parser parser)
- Construct a new MapFactory_MapDocument and set the database connection
and SAX parser.
MapFactory_MapDocument
public MapFactory_MapDocument(Connection conn,
ResultSet mappedResultSet,
Parser parser)
- Construct a new MapFactory_MapDocument and set the database connection,
SAX parser, and result set.
A result set is needed only when one of the tables in the mapping
document is named "Result Set". It is used to retrieve metadata about
the columns in the result set.
getConnection
public Connection getConnection()
- Get the current Connection.
- Returns:
- The current Connection.
setConnection
public void setConnection(Connection conn)
- Set the current Connection.
- Parameters:
- conn - The current Connection.
getResultSet
public ResultSet getResultSet()
- Get the current ResultSet.
- Returns:
- The current ResultSet.
setResultSet
public void setResultSet(ResultSet mappedResultSet)
- Set the current ResultSet.
- Parameters:
- mappedResultSet - The current ResultSet.
getParser
public Parser getParser()
- Get the current SAX Parser.
- Returns:
- The current SAX Parser.
setParser
public void setParser(Parser parser)
- Set the current SAX Parser.
- Parameters:
- parser - The current SAX Parser.
createMap
public Map createMap(Connection conn,
ResultSet mappedResultSet,
Parser parser,
InputSource src) throws InvalidMapException, SQLException
- Set the connection, mapped result set (if any), and SAX parser, then
create a map from a mapping document.
- Parameters:
- conn - The current Connection.
- mappedResultSet - The current ResultSet. This should be null if
the mapping document does not map an element type-as-class to the
table named "Result Set".
- parser - The current SAX Parser.
- src - A SAX InputSource for the mapping document.
- Throws: InvalidMapException
- Thrown if the mapping document contained
a mistake.
- Throws: SQLException
- Thrown if an error occurred retrieving column
metadata from the database or result set.
createMap
public Map createMap(InputSource src) throws InvalidMapException, SQLException
- Create a map from a mapping document.
- Parameters:
- src - A SAX InputSource for the mapping document.
- Throws: InvalidMapException
- Thrown if the mapping document contained
a mistake.
- Throws: SQLException
- Thrown if an error occurred retrieving column
metadata from the database or result set.
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Implementation of setDocumentLocator in SAX' DocumentHandler interface.
This method is called by the SAX Parser and should not be called by
XML-DBMS programmers.
startDocument
public void startDocument() throws SAXException
- Implementation of startDocument in SAX' DocumentHandler interface.
This method is called by the SAX Parser and should not be called by
XML-DBMS programmers.
endDocument
public void endDocument() throws SAXException
- Implementation of endDocument in SAX' DocumentHandler interface.
This method is called by the SAX Parser and should not be called by
XML-DBMS programmers.
startElement
public void startElement(String name,
AttributeList attrs) throws SAXException
- Implementation of startElement in SAX' DocumentHandler interface.
This method is called by the SAX Parser and should not be called by
XML-DBMS programmers.
endElement
public void endElement(String name) throws SAXException
- Implementation of endElement in SAX' DocumentHandler interface.
This method is called by the SAX Parser and should not be called by
XML-DBMS programmers.
characters
public void characters(char ch[],
int start,
int length) throws SAXException
- Implementation of characters in SAX' DocumentHandler interface.
This method is called by the SAX Parser and should not be called by
XML-DBMS programmers.
ignorableWhitespace
public void ignorableWhitespace(char ch[],
int start,
int length) throws SAXException
- Implementation of ignorableWhitespace in SAX' DocumentHandler interface.
This method is called by the SAX Parser and should not be called by
XML-DBMS programmers.
processingInstruction
public void processingInstruction(String target,
String data) throws SAXException
- Implementation of processingInstruction in SAX' DocumentHandler interface.
This method is called by the SAX Parser and should not be called by
XML-DBMS programmers.
All Packages Class Hierarchy This Package Previous Next Index