本文整理了Java中org.eclipse.persistence.exceptions.XMLMarshalException.errorInstantiatingSchemaPlatform()
方法的一些代码示例,展示了XMLMarshalException.errorInstantiatingSchemaPlatform()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLMarshalException.errorInstantiatingSchemaPlatform()
方法的具体详情如下:
包路径:org.eclipse.persistence.exceptions.XMLMarshalException
类名称:XMLMarshalException
方法名:errorInstantiatingSchemaPlatform
暂无
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
public SAXUnmarshaller(Unmarshaller xmlUnmarshaller, Map<String, Boolean> parserFeatures) throws XMLMarshalException {
super();
this.parserFeatures = parserFeatures;
try {
this.xmlUnmarshaller = xmlUnmarshaller;
} catch (Exception e) {
throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public SAXUnmarshaller(Unmarshaller xmlUnmarshaller, Map<String, Boolean> parserFeatures) throws XMLMarshalException {
super();
this.parserFeatures = parserFeatures;
try {
this.xmlUnmarshaller = xmlUnmarshaller;
} catch (Exception e) {
throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
private SAXParser getSAXParser() {
if (null == saxParser) {
try {
saxParser = getSAXParserFactory().newSAXParser();
} catch (Exception e) {
throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
}
}
return saxParser;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
private SAXParser getSAXParser() {
if(null == saxParser) {
try {
saxParser = getSAXParserFactory().newSAXParser();
} catch (Exception e) {
throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
}
}
return saxParser;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
private SAXParserFactory getSAXParserFactory() throws XMLMarshalException {
if(null == saxParserFactory) {
try {
saxParserFactory = SAXParserFactory.newInstance();
saxParserFactory.setNamespaceAware(true);
saxParserFactory.setFeature(XMLReader.NAMESPACE_PREFIXES_FEATURE, true);
try {
saxParserFactory.setFeature(XMLReader.REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE_FEATURE, true);
} catch(org.xml.sax.SAXNotRecognizedException ex) {
//ignore if the parser doesn't recognize or support this feature
} catch(org.xml.sax.SAXNotSupportedException ex) {
}
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) {
}
}
}
return saxParserFactory;
} catch (Exception e) {
throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
}
}
return saxParserFactory;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
private SAXParserFactory getSAXParserFactory() throws XMLMarshalException {
if (null == saxParserFactory || shouldReset) {
try {
saxParserFactory = XMLHelper.createParserFactory(isSecureProcessingDisabled());;
saxParserFactory.setFeature(XMLReader.NAMESPACE_PREFIXES_FEATURE, true);
try {
saxParserFactory.setFeature(XMLReader.REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE_FEATURE, true);
} catch (org.xml.sax.SAXNotRecognizedException ex) {
// ignore if the parser doesn't recognize or support this feature
} catch (org.xml.sax.SAXNotSupportedException ex) {
}
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) {
}
}
}
return saxParserFactory;
} catch (Exception e) {
throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
}
}
return saxParserFactory;
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
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);
}
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
public void setSchema(Schema schema) {
saxParserFactory.setSchema(schema);
try {
saxParser = saxParserFactory.newSAXParser();
XMLReader newXmlReader = new XMLReader(saxParser.getXMLReader());
newXmlReader.setFeature(VALIDATING, xmlReader.getFeature(VALIDATING));
newXmlReader.setEntityResolver(xmlReader.getEntityResolver());
newXmlReader.setErrorHandler(xmlReader.getErrorHandler());
xmlReader = newXmlReader;
xmlParser.setXMLSchema(schema);
} catch (Exception e) {
throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
private XMLReader getNewXMLReader(Class clazz, MediaType mediaType) {
if (null != mediaType && mediaType.isApplicationJSON()) {
return new JsonStructureReader(xmlUnmarshaller, clazz);
}
try {
XMLReader xmlReader = new XMLReader(getSAXParser().getXMLReader());
if (null != errorHandler) {
xmlReader.setErrorHandler(errorHandler);
}
if (null != entityResolver) {
xmlReader.setEntityResolver(entityResolver);
}
setValidationMode(xmlReader, getValidationMode());
if (null != getSchema()) {
xmlReader.setFeature(VALIDATING, xmlReader.getFeature(VALIDATING));
}
return xmlReader;
} catch (Exception e) {
throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
private XMLReader getNewXMLReader(Class clazz, MediaType mediaType) {
if(null != mediaType && mediaType.isApplicationJSON()){
return new JsonStructureReader(xmlUnmarshaller, clazz);
}
try {
XMLReader xmlReader = new XMLReader(getSAXParser().getXMLReader());
if(null != errorHandler) {
xmlReader.setErrorHandler(errorHandler);
}
if(null != entityResolver) {
xmlReader.setEntityResolver(entityResolver);
}
setValidationMode(xmlReader, getValidationMode());
if(null != getSchema()) {
xmlReader.setFeature(VALIDATING, xmlReader.getFeature(VALIDATING));
}
return xmlReader;
} catch (Exception e) {
throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!