org.biojava.bio.program.xff
Interface ElementRecognizer

All Known Implementing Classes:
ElementRecognizer.AllElementRecognizer, ElementRecognizer.ByLocalName, ElementRecognizer.ByNSName, ElementRecognizer.HasAttribute

public interface ElementRecognizer

Simple interface for filtering SAX/StAX startElement events.

A number of standard implementations are provided for your convenience. To implement your own filters, just implement the filterStartElement method.

Since:
1.2
Author:
Thomas Down, Matthew Pocock

Nested Class Summary
static class ElementRecognizer.AllElementRecognizer
           
static class ElementRecognizer.ByLocalName
          Filter elements by local name (not recommended).
static class ElementRecognizer.ByNSName
          Filter elements by name and namespace.
static class ElementRecognizer.HasAttribute
          Filter elements on the existence of a specified attribute.
 
Field Summary
static ElementRecognizer ALL
           
 
Method Summary
 boolean filterStartElement(java.lang.String nsURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)
          Recognize an element based upon the start element parameters.
 

Field Detail

ALL

static final ElementRecognizer ALL
Method Detail

filterStartElement

boolean filterStartElement(java.lang.String nsURI,
                           java.lang.String localName,
                           java.lang.String qName,
                           org.xml.sax.Attributes attrs)
Recognize an element based upon the start element parameters.

Parameters:
nsURI - the uri of the element to filter
localName - the local name of the element to filter
qName - the qName of the element to filter
attrs - the attributes associated with the element to filter
Returns:
true if this element is accepted, false otherwise