ParserConfigurationException pcex = new ParserConfigurationException( "Unable to validate using XSD: Your JAXP provider [" + factory + "] does not support XML Schema. Are you running on Java 1.4 with Apache Crimson? " +
@Override public SAXParser newSAXParser() throws ParserConfigurationException { if (isValidating()) { throw new ParserConfigurationException( "No validating SAXParser implementation available"); } try { return new SAXParserImpl(features); } catch (Exception ex) { throw new ParserConfigurationException(ex.toString()); } }
@Override public boolean getFeature(String name) throws ParserConfigurationException { if (name == null) { throw new NullPointerException("name == null"); } if (NAMESPACES.equals(name)) { return isNamespaceAware(); } else if (VALIDATION.equals(name)) { return isValidating(); } else { throw new ParserConfigurationException(name); } }
ParserConfigurationException pcex = new ParserConfigurationException( "Unable to validate using XSD: Your JAXP provider [" + factory + "] does not support XML Schema. Are you running on Java 1.4 with Apache Crimson? " +
@Override public void setFeature(String name, boolean value) throws ParserConfigurationException { if (name == null) { throw new NullPointerException("name == null"); } if (NAMESPACES.equals(name)) { setNamespaceAware(value); } else if (VALIDATION.equals(name)) { setValidating(value); } else { throw new ParserConfigurationException(name); } }
if (validating) { if (validatingFactory == null) { throw new ParserConfigurationException("No validating parser factory available"); } else if (!validatingFactory.isValidating()) { throw new ParserConfigurationException("factory should be validating but isn't");
if (validating) { if (validatingFactory == null) { throw new ParserConfigurationException("No validating parser factory available"); } else if (!validatingFactory.isValidating()) { throw new ParserConfigurationException("factory should be validating but isn't");
@Override public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException { if (isValidating()) { throw new ParserConfigurationException( "No validating DocumentBuilder implementation available"); } /** * TODO If Android is going to support a different DocumentBuilder * implementations, this should be wired here. If we wanted to * allow different implementations, these could be distinguished by * a special feature (like http://www.org.apache.harmony.com/xml/expat) * or by throwing the full SPI monty at it. */ DocumentBuilderImpl builder = new DocumentBuilderImpl(); builder.setCoalescing(isCoalescing()); builder.setIgnoreComments(isIgnoringComments()); builder.setIgnoreElementContentWhitespace(isIgnoringElementContentWhitespace()); builder.setNamespaceAware(isNamespaceAware()); // TODO What about expandEntityReferences? return builder; }
/** * Method for dynamic creation of the xpath streaming parser handler. * * <p>We do this to allow the jxpath component to be removed... and avoid its dependencies. * * @param configuration * @param xpath * @return */ static StreamingParserHandler createJXpathStreamingParserHandler( Configuration configuration, String xpath) throws ParserConfigurationException { Class clazz; try { clazz = Class.forName("org.geotools.xsd.impl.jxpath.JXPathStreamingParserHandler"); } catch (ClassNotFoundException e) { throw (ParserConfigurationException) new ParserConfigurationException().initCause(e); } Constructor c; try { c = clazz.getConstructor(new Class[] {Configuration.class, String.class}); return (StreamingParserHandler) c.newInstance(new Object[] {configuration, xpath}); } catch (Exception e) { // shoudl not happen throw new RuntimeException(e); } // return new JXPathStreamingParserHandler(configuration, xpath) }
ParserConfigurationException pcex = new ParserConfigurationException( "Unable to validate using XSD: Your JAXP provider [" + factory + "] does not support XML Schema. Are you running on Java 1.4 with Apache Crimson? " +
new ParserConfigurationException().initCause(e); } catch (TransformerException e) { throw (IOException) new IOException().initCause(e);
public void setFeature(String arg0, boolean arg1) throws ParserConfigurationException { // currently we do not support setting any feature // as per spec, we should throw an exception throw new ParserConfigurationException(arg0 + " Not supported"); }
@Override public SAXParser newSAXParser() throws ParserConfigurationException { if (isValidating()) { throw new ParserConfigurationException( "No validating SAXParser implementation available"); } try { return new SAXParserImpl(features); } catch (Exception ex) { throw new ParserConfigurationException(ex.toString()); } }
@Override public SAXParser newSAXParser() throws ParserConfigurationException { if (isValidating()) { throw new ParserConfigurationException( "No validating SAXParser implementation available"); } try { return new SAXParserImpl(features); } catch (Exception ex) { throw new ParserConfigurationException(ex.toString()); } }
@Override public SAXParser newSAXParser() throws ParserConfigurationException { if (isValidating()) { throw new ParserConfigurationException( "No validating SAXParser implementation available"); } try { return new SAXParserImpl(features); } catch (Exception ex) { throw new ParserConfigurationException(ex.toString()); } }
@Override public SAXParser newSAXParser() throws ParserConfigurationException { if (isValidating()) { throw new ParserConfigurationException( "No validating SAXParser implementation available"); } try { return new SAXParserImpl(features); } catch (Exception ex) { throw new ParserConfigurationException(ex.toString()); } }
public JaasConfig parse(URL resource) throws Exception { List<String> errors = new ArrayList<>(); JaasConfig result = parse0(resource, new JaasConfigHandler(errors)); if (!errors.isEmpty()) { throw new ParserConfigurationException(errors.get(0)); } return result; }
@Override public boolean getFeature(String name) throws ParserConfigurationException { if (name == null) { throw new NullPointerException("name == null"); } if (NAMESPACES.equals(name)) { return isNamespaceAware(); } else if (VALIDATION.equals(name)) { return isValidating(); } else { throw new ParserConfigurationException(name); } }
@Override public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException { if (isThrowInNewDocumentBuilder) { throw new ParserConfigurationException("Intentionally throwing config exception"); } DocumentBuilder documentBuilder = mock(DocumentBuilder.class); return documentBuilder; }
public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException { if(isValidating()) try { return new ValidatingDocumentBuilder(_WrappedFactory.newDocumentBuilder(), _Schema.newVerifier()); } catch(VerifierConfigurationException verifierconfigurationexception) { throw new ParserConfigurationException(verifierconfigurationexception.getMessage()); } else return _WrappedFactory.newDocumentBuilder(); }