nbi.xmlsec.biocase.protocol.filter
Class OperatorFilter

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

public class OperatorFilter
extends ProtocolFilter

The class OperatorFilter prepares the parsing of COP or LOP operators using the classes COPFilteror LOPFilter respectively.

All SAX events are forwarded to the defined ContentHandler. The parsed operator type may be retrieved with the method getOperator().

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

Field Summary
static String LN_ROOT
          Local name of the root element filter
(package private)  Operator operator
          Stores the parsed operator
(package private)  ProtocolFilter opFilter
          Current subfilter parse COP or LOP
(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
OperatorFilter(String protocolURI, int filterMode)
          Inits the filter instance.
OperatorFilter(String protocolURI, String rootElement, int filterMode)
          Inits the filter instance.
OperatorFilter(XMLReader parent, String protocolURI, int filterMode)
          Inits the filter instance with specified parent.
OperatorFilter(XMLReader parent, String protocolURI, String rootElement, int filterMode)
          Inits the filter instance with specified parent.
 
Method Summary
protected  nbi.xml.sax.SAXElement filterElement(nbi.xml.sax.SAXElement element)
          Registers COP or LOP as subfilter, depending on the first received element.
 Operator getOperator()
          Gets the Operator
protected  nbi.xml.sax.SAXElement parseElement(nbi.xml.sax.SAXElement element)
          When subfilter finishes, stores the parsed operator.
 
Methods inherited from class nbi.xmlsec.biocase.protocol.filter.ProtocolFilter
characters, checkFilterParameter, endElement, filterCharacters, getFilterMode, getFilterParameter, getProtocolURI, isParsingComplete, parseComplete, parseInit, 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 final String LN_ROOT
Local name of the root element filter

See Also:
Constant Field Values

trackMode

static final int trackMode
Track mode for the filter stack

See Also:
Constant Field Values

operator

Operator operator
Stores the parsed operator


opFilter

ProtocolFilter opFilter
Current subfilter parse COP or LOP

Constructor Detail

OperatorFilter

public OperatorFilter(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.

OperatorFilter

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

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

OperatorFilter

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

Parameters:
parent - parent reader.
protocolURI - protocol version URI of this filter.
rootElement - Local name of the root element.
filterMode - filterMode of this filter ProtocolFilter.filterMode.

OperatorFilter

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

Parameters:
protocolURI - protocol version URI of this filter.
rootElement - Local name of the root element.
filterMode - filterMode of this filter ProtocolFilter.filterMode.
Method Detail

getOperator

public Operator getOperator()
Gets the Operator

Returns:
Returns the operator.

filterElement

protected nbi.xml.sax.SAXElement filterElement(nbi.xml.sax.SAXElement element)
                                        throws SAXException
Registers COP or LOP as subfilter, depending on the first received element.

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

parseElement

protected nbi.xml.sax.SAXElement parseElement(nbi.xml.sax.SAXElement element)
                                       throws SAXException
When subfilter finishes, stores the parsed operator.

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)


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