/** * Default constructor. */ public JAXPParser() { super(); errorHandler = DefaultErrorHandler.getInstance(); }
public JAXPParser() { super(); documentBuilderFactory = DocumentBuilderFactory.newInstance(); errorHandler = new DefaultErrorHandler(); setNamespaceAware(true); setWhitespacePreserving(false); }
public SAXUnmarshaller(XMLUnmarshaller xmlUnmarshaller, Map<String, Boolean> parserFeatures) throws XMLMarshalException { super(); try { saxParserFactory = SAXParserFactory.newInstance(); saxParserFactory.setNamespaceAware(true); saxParserFactory.setFeature("http://xml.org/sax/features/namespace-prefixes", true); if(null != parserFeatures) { for(Map.Entry<String, Boolean> parserFeature : parserFeatures.entrySet()) { try { saxParserFactory.setFeature(parserFeature.getKey(), parserFeature.getValue()); } catch(org.xml.sax.SAXNotRecognizedException ex) { //ignore if the parser doesn't recognize or support this feature } catch(org.xml.sax.SAXNotSupportedException ex) { } } } saxParser = saxParserFactory.newSAXParser(); xmlReader = new XMLReader(saxParser.getXMLReader()); xmlReader.setErrorHandler(new DefaultErrorHandler()); xmlParser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser(); xmlParser.setNamespaceAware(true); xmlParser.setValidationMode(XMLParser.NONVALIDATING); this.xmlUnmarshaller = xmlUnmarshaller; } catch (Exception e) { throw XMLMarshalException.errorInstantiatingSchemaPlatform(e); } }
/** * Default constructor. */ public JAXPParser() { super(); errorHandler = DefaultErrorHandler.getInstance(); }
/** * This constructor can increase performance by providing existing documentBuilderFactory and errorHandler. * * @param documentBuilderFactory existing document builder factory * @param errorHandler existing error handler */ public JAXPParser(DocumentBuilderFactory documentBuilderFactory, ErrorHandler errorHandler) { super(); this.documentBuilderFactory = documentBuilderFactory; if (null != errorHandler) { this.errorHandler = errorHandler; } else { this.errorHandler = DefaultErrorHandler.getInstance(); } }
/** * This constructor can increase performance by providing existing documentBuilderFactory and errorHandler. * * @param documentBuilderFactory existing document builder factory * @param errorHandler existing error handler */ public JAXPParser(DocumentBuilderFactory documentBuilderFactory, ErrorHandler errorHandler) { super(); this.documentBuilderFactory = documentBuilderFactory; if (null != errorHandler) { this.errorHandler = errorHandler; } else { this.errorHandler = DefaultErrorHandler.getInstance(); } }