Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasig.portal.tools.dbloader
Class DataHandler

    java.lang.Object
      org.xml.sax.helpers.DefaultHandler
          org.jasig.portal.tools.dbloader.DataHandler

All Implemented Interfaces:
  org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

     class DataHandler

extends org.xml.sax.helpers.DefaultHandler

Handles SAX events resulting from parsing of the data.xml file.

Version:
  $Revision: 1.5 $
Author:
  Ken Weiner, kweiner@unicon.net, Mark Boyd

Nested Class Summary
`(package private) class` | `DataHandler.Column`
`(package private) class` | `DataHandler.Row`
`(package private) class` | `DataHandler.Table`

Field Summary
`(package private) java.lang.String` | `action`
`private java.lang.StringBuffer` | `charBuff`
`(package private) DataHandler.Column` | `column`
`private Configuration` | `config`
`private boolean` | `insideColumn`
`private boolean` | `insideData`
`private boolean` | `insideName`
`private boolean` | `insideRow`
`private static boolean` | `insideSequence`
`private boolean` | `insideTable`
`private boolean` | `insideValue`
`(package private) DataHandler.Row` | `row`
`private static java.lang.String` | `sequenceId`
`private static java.util.Map` | `sequences`
`private boolean` | `supportsPreparedStatements`
`(package private) DataHandler.Table` | `table`
`(package private) java.lang.String` | `type`

Constructor Summary
`DataHandler(Configuration config)`

Method Summary
`void` | `characters(char[] ch, int start, int length)`
`void` | `endDocument()`
`void` | `endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)`
`private void` | `executeSQL(DataHandler.Table table, DataHandler.Row row, java.lang.String action)`
`private java.lang.String` | `prepareDeleteStatement(DataHandler.Row row, boolean preparedStatement)`
`private java.lang.String` | `prepareInsertStatement(DataHandler.Row row, boolean preparedStatement)`
`private java.lang.String` | `prepareUpdateStatement(DataHandler.Row row)`
`static java.lang.String` | `sqlEscape(java.lang.String sql)` Make a string SQL safe
`void` | `startDocument()`
`void` | `startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)`
`private static boolean` | `supportsPreparedStatements(Configuration config)`

Methods inherited from class org.xml.sax.helpers.DefaultHandler
`endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### config

    private Configuration config

### charBuff

    private java.lang.StringBuffer charBuff

### insideData

    private boolean insideData

### insideTable

    private boolean insideTable

### insideName

    private boolean insideName

### insideRow

    private boolean insideRow

### insideColumn

    private boolean insideColumn

### insideValue

    private boolean insideValue

### insideSequence

    private static boolean insideSequence

### supportsPreparedStatements

    private boolean supportsPreparedStatements

### sequenceId

    private static java.lang.String sequenceId

### sequences

    private static java.util.Map sequences

### table

    DataHandler.Table table

### row

    DataHandler.Row row

### column

    DataHandler.Column column

### action

    java.lang.String action

### type

    java.lang.String type

Constructor Detail

### DataHandler

    public DataHandler(Configuration config)

Method Detail

### startDocument

    public void startDocument()

  Specified by:
    `startDocument` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `startDocument` in class `org.xml.sax.helpers.DefaultHandler`

### endDocument

    public void endDocument()

  Specified by:
    `endDocument` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `endDocument` in class `org.xml.sax.helpers.DefaultHandler`

### startElement

    public void startElement(java.lang.String namespaceURI,
                             java.lang.String localName,
                             java.lang.String qName,
                             org.xml.sax.Attributes atts)

  Specified by:
    `startElement` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `startElement` in class `org.xml.sax.helpers.DefaultHandler`

### endElement

    public void endElement(java.lang.String namespaceURI,
                           java.lang.String localName,
                           java.lang.String qName)
                    throws org.xml.sax.SAXException

  Specified by:
    `endElement` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `endElement` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXException`

### characters

    public void characters(char[] ch,
                           int start,
                           int length)

  Specified by:
    `characters` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `characters` in class `org.xml.sax.helpers.DefaultHandler`

### prepareInsertStatement

    private java.lang.String prepareInsertStatement(DataHandler.Row row,
                                                    boolean preparedStatement)

### prepareDeleteStatement

    private java.lang.String prepareDeleteStatement(DataHandler.Row row,
                                                    boolean preparedStatement)

### prepareUpdateStatement

    private java.lang.String prepareUpdateStatement(DataHandler.Row row)

### sqlEscape

    public static final java.lang.String sqlEscape(java.lang.String sql)

  Make a string SQL safe

  Parameters:
    `sql` - the string containing sql to escape
  Returns:
    SQL safe string

### executeSQL

    private void executeSQL(DataHandler.Table table,
                            DataHandler.Row row,
                            java.lang.String action)

### supportsPreparedStatements

    private static boolean supportsPreparedStatements(Configuration config)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD