Code example for Validator

Methods: setErrorHandlervalidate

0
                System.out.println(e.getMessage());
                errors.add(e);
            } 
        }; 
 
        v.setErrorHandler(handler);
        v.validate(new StreamSource(new ByteArrayInputStream(data)));
 
        assertTrue(errors.isEmpty());
    } 
 
    public void testEncodeFeatureWithBounds() throws Exception {
        SimpleFeature feature = GML3MockData.feature();
        TestConfiguration configuration  = new TestConfiguration();
        //configuration.getProperties().add( org.geotools.gml2.GMLConfiguration.NO_FEATURE_BOUNDS ); 
     
        Encoder encoder = new Encoder( configuration );
        Document dom = encoder.encodeAsDOM(feature, TEST.TestFeature );
         
        assertEquals( 1, dom.getElementsByTagName("gml:boundedBy").getLength());