parser.setStrict(shouldSetParserStrict);
@SuppressWarnings("unchecked") public Object read(Object request, Reader reader, Map kvp) throws Exception { Parser parser = new Parser(configuration); parser.setValidating(true); parser.setFailOnValidationError(true); parser.setStrict(true); Object parsed; try { parsed = parser.parse(reader); } catch (Exception e) { throw new ServiceException("Could not parse XML request.", e); } if (!parser.getValidationErrors().isEmpty()) { ServiceException exception = new ServiceException("Invalid request", "InvalidParameterValue"); for (Exception error : (List<Exception>) parser.getValidationErrors()) { LOGGER.warning(error.getLocalizedMessage()); exception.getExceptionText().add(error.getLocalizedMessage()); } } return parsed; } }
@SuppressWarnings("unchecked") public Object read(Object request, Reader reader, Map kvp) throws Exception { Parser parser = new Parser(configuration); parser.setValidating(true); parser.setFailOnValidationError(true); parser.setStrict(true); parser.setEntityResolver(resolverProvider.getEntityResolver()); Object parsed; try { parsed = parser.parse(reader); } catch (Exception e) { throw new ServiceException("Could not parse XML request.", e); } if (!parser.getValidationErrors().isEmpty()) { ServiceException exception = new ServiceException("Invalid request", "InvalidParameterValue"); for (Exception error : (List<Exception>) parser.getValidationErrors()) { LOGGER.warning(error.getLocalizedMessage()); exception.getExceptionText().add(error.getLocalizedMessage()); } } return parsed; } }
public GTVectorDataBinding parse(InputStream input, QName schematypeTuple) { if(!setBasicGMLConfiguration){ if (configuration == null) { configuration = resolveConfiguration(schematypeTuple); } }else{ configuration = new GMLConfiguration(); } Parser parser = new Parser(configuration); parser.setStrict(!setParserNonStrict); //parse FeatureCollection<?, SimpleFeature> fc = resolveFeatureCollection(parser, input); GTVectorDataBinding data = new GTVectorDataBinding(fc); return data; }
public Object read(Object request, Reader reader, Map kvp) throws Exception { //create the parser instance Parser parser = new Parser(configuration); parser.setValidating(true); parser.setFailOnValidationError(true); parser.setStrict(true); // parse Object parsed; try { parsed = parser.parse(reader); } catch(Exception e) { throw new WcsException("Parsing failed, the xml request is most probably not compliant to the wcs schema", e); } return parsed; } }
public Object read(Object request, Reader reader, Map kvp) throws Exception { // create the parser instance Parser parser = new Parser(configuration); parser.setValidating(true); parser.setFailOnValidationError(true); parser.setStrict(true); parser.setEntityResolver(resolverProvider.getEntityResolver()); // parse Object parsed; try { parsed = parser.parse(reader); } catch (Exception e) { throw new WcsException( "Parsing failed, the xml request is most probably not compliant to the wcs schema", e); } return parsed; } }
public Object read(Object request, Reader reader, Map kvp) throws Exception { // create the parser instance Parser parser = new Parser(configuration); parser.setValidating(true); parser.setFailOnValidationError(true); parser.setStrict(true); parser.setEntityResolver(resolverProvider.getEntityResolver()); // parse Object parsed; try { parsed = parser.parse(reader); } catch (Exception e) { throw new WcsException( "Parsing failed, the xml request is most probably not compliant to the wcs schema", e); } return parsed; } }
parser.setStrict(shouldSetParserStrict);
try { Parser parser = new Parser(new WFSConfiguration()); parser.setStrict(false); parser.setEntityResolver(resolverProvider.getEntityResolver()); Object result = parser.parse(is);