apollo.dataadapter.das.simple
Class DASFeatureContentHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by apollo.dataadapter.das.simple.DASFeatureContentHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class DASFeatureContentHandler
extends org.xml.sax.helpers.DefaultHandler

I am the ContentHandler used when SimpleDASServer parses the result of a 'features' call to a das data source (with a specified dsn and segment).

I am DAS 1.0 compliant.

During the parse, I create a list, stored on myself, of the returned features. This list is retrieved by calling getFeaturess after the parse is complete

If any of the features retrieved during my run contain subparts or are reference features (have children), then I store them away. When I am done with my parse, I re-invoke the SimpleDASServer with another getFeatures call, passing in all the segments that have children. which creates another instance of me(!) and starts a another parse of the child-features. This is how I assemble all features for a given parent.

Author:
Vivek Iyer
See Also:
SimpleDASServer.getEntryPoints(apollo.dataadapter.das.DASDsn)

Field Summary
 DASDsn dsn
           
 java.util.HashMap parentFeatures
           
 java.util.HashMap parentFeaturesOfSegmentsToBeRequested
           
 java.util.HashMap segments
           
 java.util.HashMap segmentsToBeRequested
           
 DASServerI server
           
 
Constructor Summary
DASFeatureContentHandler()
           
DASFeatureContentHandler(DASServerI theServer, DASDsn theDsn, java.util.HashMap theSegments, java.util.HashMap theParentFeatures, long theGlobalStart, long theGlobalEnd)
           
 
Method Summary
 void characters(char[] text, int start, int length)
           
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qualifiedName)
           
 java.util.List getFeatures()
           
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qualifiedName, org.xml.sax.Attributes attributes)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

public DASServerI server

parentFeatures

public java.util.HashMap parentFeatures

segments

public java.util.HashMap segments

dsn

public DASDsn dsn

segmentsToBeRequested

public java.util.HashMap segmentsToBeRequested

parentFeaturesOfSegmentsToBeRequested

public java.util.HashMap parentFeaturesOfSegmentsToBeRequested
Constructor Detail

DASFeatureContentHandler

public DASFeatureContentHandler()

DASFeatureContentHandler

public DASFeatureContentHandler(DASServerI theServer,
                                DASDsn theDsn,
                                java.util.HashMap theSegments,
                                java.util.HashMap theParentFeatures,
                                long theGlobalStart,
                                long theGlobalEnd)
Method Detail

getFeatures

public java.util.List getFeatures()

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qualifiedName,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qualifiedName)
                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[] text,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException