class FilterHandler extends BetterDefaultHandler {

    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes)
    {
        super.startElement(uri, localName, qName, attributes);

        if (GeometryHandlerFactory.GML_POLYGON_TAG.equals(localName))
        {
            myCurrentGeometryHandler = GeometryHandlerFactory.getGeometryHandler(localName, false);
        }
        else if (EnvelopeHandler.ENVELOPE_TAG.equals(localName))
        {
            myCurrentGeometryHandler = new EnvelopeHandler();
        }
        if (myCurrentGeometryHandler != null)
        {
            myCurrentGeometryHandler.handleOpeningTag(localName);
        }
    }

}