nbi.xmlsec.biocase.protocol.filter
Class HeaderFilter

java.lang.Object
  extended byorg.xml.sax.helpers.XMLFilterImpl
      extended bynbi.xmlsec.biocase.protocol.filter.ProtocolFilter
          extended bynbi.xmlsec.biocase.protocol.filter.HeaderFilter
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, XMLFilter, XMLReader

public class HeaderFilter
extends ProtocolFilter

This class parses an BioCASE header from a SAX stream.

All SAX events are forwarded to the defined ContentHandler. The parsed Header may be retrieved with getHeader().

Since:
Version:
$Revision: 1.12 $
Author:
Lutz Suhrbier

Field Summary
private  Header header
          The parsed BioCASE header
static String LN_DEST
          Local name of the element destination
static String LN_DEST_RESOURCE
          Local name of the attribute resource of the element destination
static String LN_ROOT
          Local name of the root element header
static String LN_SENDTIME
          Local name of the element sendTime
static String LN_SRC
          Local name of the element source
static String LN_SRC_RESOURCE
          Local name of the attribute resource of the element source
static String LN_TYPE
          Local name of the element type
static String LN_VERSION
          Local name of the element version
static String LN_VERSION_SOFTWARE
          Local name of the attribute software of the element version
(package private) static int trackMode
          Track mode for the filter stack
 
Fields inherited from class nbi.xmlsec.biocase.protocol.filter.ProtocolFilter
elementStack, filterMode, FILTERMODE_FILTER, FILTERMODE_NONE, FILTERMODE_PARSER, filterRoot, logger, PROT_URI_13, PROT_URI_20
 
Fields inherited from class org.xml.sax.helpers.XMLFilterImpl
 
Constructor Summary
HeaderFilter(String protocolURI, int filterMode)
          Inits the filter instance.
HeaderFilter(XMLReader parent, String protocolURI, int filterMode)
          Inits the filter instance with specified parent.
 
Method Summary
 Header getHeader()
          Gets the header.
protected  void initSubFilter()
          Registers subfilters for subelements.
protected  nbi.xml.sax.SAXElement parseElement(nbi.xml.sax.SAXElement element)
          Parses Header subelements and build up the Header.
protected  nbi.xml.sax.SAXElement parseInit(nbi.xml.sax.SAXElement element)
          Initialises Header
 
Methods inherited from class nbi.xmlsec.biocase.protocol.filter.ProtocolFilter
characters, checkFilterParameter, endElement, filterCharacters, filterElement, getFilterMode, getFilterParameter, getProtocolURI, isParsingComplete, parseComplete, registerSubFilter, setFilterParameter, setProtocolURI, startElement, unregisterSubFilter
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, 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

LN_ROOT

public static String LN_ROOT
Local name of the root element header


LN_VERSION

public static final String LN_VERSION
Local name of the element version

See Also:
Constant Field Values

LN_VERSION_SOFTWARE

public static final String LN_VERSION_SOFTWARE
Local name of the attribute software of the element version

See Also:
Constant Field Values

LN_SENDTIME

public static final String LN_SENDTIME
Local name of the element sendTime

See Also:
Constant Field Values

LN_SRC

public static final String LN_SRC
Local name of the element source

See Also:
Constant Field Values

LN_SRC_RESOURCE

public static final String LN_SRC_RESOURCE
Local name of the attribute resource of the element source

See Also:
Constant Field Values

LN_DEST

public static final String LN_DEST
Local name of the element destination

See Also:
Constant Field Values

LN_DEST_RESOURCE

public static final String LN_DEST_RESOURCE
Local name of the attribute resource of the element destination

See Also:
Constant Field Values

LN_TYPE

public static final String LN_TYPE
Local name of the element type

See Also:
Constant Field Values

trackMode

static final int trackMode
Track mode for the filter stack

See Also:
Constant Field Values

header

private Header header
The parsed BioCASE header

Constructor Detail

HeaderFilter

public HeaderFilter(String protocolURI,
                    int filterMode)
Inits the filter instance.

Parameters:
protocolURI - protocol version URI of this filter.
filterMode - filterMode of this filter ProtocolFilter.filterMode.

HeaderFilter

public HeaderFilter(XMLReader parent,
                    String protocolURI,
                    int filterMode)
Inits the filter instance with specified parent.

Parameters:
parent - parent reader.
protocolURI - protocol version URI of this filter.
filterMode - filterMode of this filter ProtocolFilter.filterMode.
Method Detail

initSubFilter

protected void initSubFilter()
Registers subfilters for subelements.


parseElement

protected nbi.xml.sax.SAXElement parseElement(nbi.xml.sax.SAXElement element)
                                       throws SAXException
Parses Header subelements and build up the Header.

Overrides:
parseElement in class ProtocolFilter
Parameters:
element - The element corresponding to the endElement event.
Returns:
The (modified) element or null when element shall be removed.
Throws:
SAXException - If any parsing error occurs.
See Also:
ProtocolFilter.parseElement(SAXElement)

parseInit

protected nbi.xml.sax.SAXElement parseInit(nbi.xml.sax.SAXElement element)
                                    throws SAXException
Initialises Header

Overrides:
parseInit in class ProtocolFilter
Parameters:
element - The element of the startElement event (contains no value).
Returns:
The (modified) element or null when the event shall be removed.
Throws:
SAXException - If any parsing error occurs.
See Also:
ProtocolFilter.parseInit(SAXElement)

getHeader

public Header getHeader()
Gets the header.

Returns:
Returns the header.


Copyright © 2006 Lutz Suhrbier, Freie Universitšt Berlin. All Rights Reserved.