Code example for Logger

Methods: fine, finest

0
    //      LOGGER.fine("filter: " + test.getClass().toString()); 
    //      LOGGER.fine("parsed: " + test.toString()); 
    //}  
    public org.opengis.filter.Filter parseDocument(String uri) throws Exception {
        LOGGER.finest("about to create parser");
 
        SAXParserFactory factory = SAXParserFactory.newInstance();
 
        // chains all the appropriate filters together (in correct order) 
        //  and initiates parsing 
        TestFilterHandler filterHandler = new TestFilterHandler();
        FilterFilter filterFilter = new FilterFilter(filterHandler, null);
        GMLFilterGeometry geometryFilter = new GMLFilterGeometry(filterFilter);
        GMLFilterDocument documentFilter = new GMLFilterDocument(geometryFilter);
 
        //XMLReader parser = XMLReaderFactory.createXMLReader(/*"org.apache.xerces.parsers.SAXParser"*/);  
        // uncomment to use xerces parser 
        //parser.setContentHandler(documentFilter); 
        //parser.parse(uri); 
        SAXParserFactory fac = SAXParserFactory.newInstance();
        SAXParser parser = fac.newSAXParser();
 
        ParserAdapter p = new ParserAdapter(parser.getParser());
        p.setContentHandler(documentFilter);
        LOGGER.fine("just made parser, " + uri);
        p.parse(TestData.getResource(this, uri).toExternalForm());
        LOGGER.finest("just parsed: " + uri);
 
        return filterHandler.getFilter();
    } 
}