|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object O2Plib.db.DbAccession.AccContentHandler
class DbAccession.AccContentHandler
This class implements the SAX ContentHandler interface and defines callback behavior for the SAX callbacks associated with an XML document's content, stuffing data structures with correct data from xml files.
Field Summary | |
---|---|
DbAccession |
acc
where most of the data is |
private java.io.CharArrayWriter |
contents
|
private boolean |
DEBUG_CH
local debug flag |
private org.xml.sax.Locator |
locator
Hold onto the locator for location information - for debugging |
private java.util.Map |
namespaceMappings
Store URI to prefix mappings |
private java.lang.String |
previousTag
previous tag found - for debugging |
private java.lang.String[] |
rowData
instance of current row of data being assembled. |
private boolean |
sampleEntryFlag
when the begining of the list of spots is found |
private int |
tCols
the number of columns of the row to create |
Constructor Summary | |
---|---|
DbAccession.AccContentHandler()
AccContentHandler() - constructor() |
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
characters() - This reports character data (within an element). |
void |
endDocument()
endDocument() - This indicates the end of a Document parse-this occurs after all callbacks in all SAX Handlers.. |
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
endElement() - Indicates the end of an element ( </[element name]> ) is reached. |
void |
endPrefixMapping(java.lang.String prefix)
endPrefixMapping() - This indicates the end of a prefix mapping, when the namespace reported in a
callback is no longer available. |
java.lang.String |
getLocatorPrevTag()
getLocatorPrevTag() - get locator and previous tag for debugging. |
boolean |
goParse(java.lang.String fileName,
DbAccession acc)
goParse() - parse XML file for prologue, spot, and epilogue data. |
void |
ignorableWhitespace(char[] c,
int start,
int len)
ignorableWhitespace() - |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
processingInstruction() - This indicates that a processing instruction (other than the XML declaration) has been encountered. |
void |
setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator() -Provide reference to Locator which provides information about where in a document callbacks occur. |
void |
skippedEntity(java.lang.String name)
skippedEntity() - This reports an entity that is skipped by the parser. |
void |
startDocument()
startDocument() - This indicates the start of a Document parse-this precedes all callbacks in all SAX Handlers with the sole exception of . |
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
startElement() - This reports the occurrence of an actual element. |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
startPrefixMapping() - This indicates the beginning of an XML Namespace prefix mapping. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public DbAccession acc
private int tCols
private final boolean DEBUG_CH
private org.xml.sax.Locator locator
private java.util.Map namespaceMappings
private java.io.CharArrayWriter contents
private boolean sampleEntryFlag
private java.lang.String[] rowData
private java.lang.String previousTag
Constructor Detail |
---|
public DbAccession.AccContentHandler()
Method Detail |
---|
public boolean goParse(java.lang.String fileName, DbAccession acc) throws java.lang.Exception
fileName
- to readacc
- structure to save the data
java.lang.Exception
public java.lang.String getLocatorPrevTag()
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
locator
- Locator object tied to callback processpublic void startDocument() throws org.xml.sax.SAXException
setDocumentLocator(org.xml.sax.Locator)
.
startDocument
in interface org.xml.sax.ContentHandler
SAXException
- when things go wrong
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
SAXException
- when things go wrong
org.xml.sax.SAXException
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
processingInstruction
in interface org.xml.sax.ContentHandler
target
- String
target of PIdata
- String
Throws:
SAXException
- when things go wrong
org.xml.sax.SAXException
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
) occurs.
startPrefixMapping
in interface org.xml.sax.ContentHandler
prefix
- String
prefix used for the namespace
being reporteduri
- String
URI for the namespace
being reported
SAXException
- when things go wrongpublic void endPrefixMapping(java.lang.String prefix)
startPrefixMapping(java.lang.String, java.lang.String)
callback is no longer available.
endPrefixMapping
in interface org.xml.sax.ContentHandler
prefix
- String
of namespace being reported
SAXException
- when things go wrongpublic void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
xmlns:[namespace prefix]
and
xsi:schemaLocation
.
startElement
in interface org.xml.sax.ContentHandler
namespaceURI
- String
namespace URI this element
is associated with, or an empty String
localName
- String
name of element (with no
namespace prefix, if one is present)qName
- String
XML 1.0 version of element name:
[namespace prefix]:[localName]atts
- Attributes
list for this element
SAXException
- when things go wrong
org.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
</[element name]>
) is reached. Note that
the parser does not distinguish between empty elements and
non-empty elements, so this occurs uniformly.
It builds the DbSpot instance and saves it in the current spot list listG[RSAMPLE/SAMPLE] which it updates if it passes the -ssfCW filter (if enabled). It also builds the dbSample preface and epilogue structures/
endElement
in interface org.xml.sax.ContentHandler
namespaceURI
- String
URI of namespace this
element is associated withlocalName
- String
name of element without prefixqName
- String
name of element in XML 1.0 form
SAXException
- when things go wrong
org.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
ch
- char[]
character array with character datastart
- int
index in array where data starts.length
- int
index in array where data ends.
SAXException
- when things go wrong
org.xml.sax.SAXException
public void ignorableWhitespace(char[] c, int start, int len)
ignorableWhitespace
in interface org.xml.sax.ContentHandler
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException
skippedEntity
in interface org.xml.sax.ContentHandler
name
- String
name of entity being skipped
SAXException
- when things go wrong
org.xml.sax.SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |