本文整理了Java中org.eclipse.persistence.oxm.XMLUnmarshaller.isAutoDetectMediaType()
方法的一些代码示例,展示了XMLUnmarshaller.isAutoDetectMediaType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLUnmarshaller.isAutoDetectMediaType()
方法的具体详情如下:
包路径:org.eclipse.persistence.oxm.XMLUnmarshaller
类名称:XMLUnmarshaller
方法名:isAutoDetectMediaType
暂无
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
return xmlUnmarshaller.getMediaType();
} else if (key.equals(UnmarshallerProperties.AUTO_DETECT_MEDIA_TYPE)) {
return xmlUnmarshaller.isAutoDetectMediaType();
} else if (key.equals(UnmarshallerProperties.UNMARSHALLING_CASE_INSENSITIVE)) {
return xmlUnmarshaller.isCaseInsensitive();
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.moxy
return xmlUnmarshaller.getMediaType();
} else if (key.equals(UnmarshallerProperties.AUTO_DETECT_MEDIA_TYPE)) {
return xmlUnmarshaller.isAutoDetectMediaType();
} else if (key.equals(UnmarshallerProperties.UNMARSHALLING_CASE_INSENSITIVE)) {
return xmlUnmarshaller.isCaseInsensitive();
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(Reader reader) throws JAXBException {
try {
if (xmlUnmarshaller.isAutoDetectMediaType() || xmlUnmarshaller.getMediaType() == MediaType.APPLICATION_JSON || null == jaxbContext.getXMLInputFactory() || XMLUnmarshaller.NONVALIDATING != xmlUnmarshaller.getValidationMode()) {
return validateAndTransformIfRequired(xmlUnmarshaller.unmarshal(reader)); // xml bindings + object inside reader
} else {
if (null == reader) {
throw XMLMarshalException.nullArgumentException();
}
XMLStreamReader xmlStreamReader = jaxbContext.getXMLInputFactory().createXMLStreamReader(reader);
Object value = unmarshal(xmlStreamReader);
xmlStreamReader.close();
return value;
}
} catch(JAXBException jaxbException) {
throw jaxbException;
} catch (XMLMarshalException xmlMarshalException) {
throw handleXMLMarshalException(xmlMarshalException);
} catch (BeanValidationException bve) {
throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve);
} catch (Exception exception) {
throw new UnmarshalException(exception);
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.moxy
@Override
public Object unmarshal(Reader reader) throws JAXBException {
try {
if (xmlUnmarshaller.isAutoDetectMediaType() || xmlUnmarshaller.getMediaType() == MediaType.APPLICATION_JSON || null == jaxbContext.getXMLInputFactory() || XMLUnmarshaller.NONVALIDATING != xmlUnmarshaller.getValidationMode()) {
return validateAndTransformIfRequired(xmlUnmarshaller.unmarshal(reader)); // xml bindings + object inside reader
} else {
if (null == reader) {
throw XMLMarshalException.nullArgumentException();
}
XMLStreamReader xmlStreamReader = jaxbContext.getXMLInputFactory().createXMLStreamReader(reader);
Object value = unmarshal(xmlStreamReader);
xmlStreamReader.close();
return value;
}
} catch(JAXBException jaxbException) {
throw jaxbException;
} catch (XMLMarshalException xmlMarshalException) {
throw handleXMLMarshalException(xmlMarshalException);
} catch (BeanValidationException bve) {
throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve);
} catch (Exception exception) {
throw new UnmarshalException(exception);
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(InputStream inputStream) throws JAXBException {
try {
if (xmlUnmarshaller.isAutoDetectMediaType() || xmlUnmarshaller.getMediaType() == MediaType.APPLICATION_JSON || null == jaxbContext.getXMLInputFactory() || XMLUnmarshaller.NONVALIDATING != xmlUnmarshaller.getValidationMode()) {
return validateAndTransformIfRequired(xmlUnmarshaller.unmarshal(inputStream)); // xml bindings + object inside inputStream
} else {
if (null == inputStream) {
throw XMLMarshalException.nullArgumentException();
}
XMLStreamReader xmlStreamReader;
xmlStreamReader = jaxbContext.getXMLInputFactory().createXMLStreamReader(inputStream);
Object value = unmarshal(xmlStreamReader);
xmlStreamReader.close();
return value;
}
} catch(JAXBException jaxbException) {
throw jaxbException;
} catch (BeanValidationException bve) {
throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve);
} catch (XMLMarshalException xmlMarshalException) {
throw handleXMLMarshalException(xmlMarshalException);
} catch (Exception exception) {
throw new UnmarshalException(exception);
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.moxy
@Override
public Object unmarshal(InputStream inputStream) throws JAXBException {
try {
if (xmlUnmarshaller.isAutoDetectMediaType() || xmlUnmarshaller.getMediaType() == MediaType.APPLICATION_JSON || null == jaxbContext.getXMLInputFactory() || XMLUnmarshaller.NONVALIDATING != xmlUnmarshaller.getValidationMode()) {
return validateAndTransformIfRequired(xmlUnmarshaller.unmarshal(inputStream)); // xml bindings + object inside inputStream
} else {
if (null == inputStream) {
throw XMLMarshalException.nullArgumentException();
}
XMLStreamReader xmlStreamReader;
xmlStreamReader = jaxbContext.getXMLInputFactory().createXMLStreamReader(inputStream);
Object value = unmarshal(xmlStreamReader);
xmlStreamReader.close();
return value;
}
} catch(JAXBException jaxbException) {
throw jaxbException;
} catch (BeanValidationException bve) {
throw new UnmarshalException(bve.getMessage(), String.valueOf(bve.getErrorCode()), bve);
} catch (XMLMarshalException xmlMarshalException) {
throw handleXMLMarshalException(xmlMarshalException);
} catch (Exception exception) {
throw new UnmarshalException(exception);
}
}
内容来源于网络,如有侵权,请联系作者删除!