本文整理了Java中org.eclipse.persistence.oxm.XMLUnmarshaller.isApplicationXML()
方法的一些代码示例,展示了XMLUnmarshaller.isApplicationXML()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLUnmarshaller.isApplicationXML()
方法的具体详情如下:
包路径:org.eclipse.persistence.oxm.XMLUnmarshaller
类名称:XMLUnmarshaller
方法名:isApplicationXML
暂无
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(Node node) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
Element element = null;
switch (node.getNodeType()) {
case Node.DOCUMENT_NODE: {
element = ((Document) node).getDocumentElement();
break;
}
case Node.ELEMENT_NODE: {
element = (Element) node;
break;
}
default:
throw XMLMarshalException.unmarshalException();
}
return xmlToObject(new DOMRecord(element));
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(Node node, Class clazz) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
Element element = null;
switch (node.getNodeType()) {
case Node.DOCUMENT_NODE: {
element = ((Document) node).getDocumentElement();
break;
}
case Node.ELEMENT_NODE: {
element = (Element) node;
break;
}
default:
throw XMLMarshalException.unmarshalException();
}
return xmlToObject(new DOMRecord(element), clazz);
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(XMLReader xmlReader, InputSource inputSource) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
SAXDocumentBuilder saxDocumentBuilder = new SAXDocumentBuilder();
xmlReader.setContentHandler(saxDocumentBuilder);
xmlReader.parse(inputSource);
return xmlToObject(new DOMRecord(saxDocumentBuilder.getDocument()));
} catch(IOException e) {
throw XMLMarshalException.unmarshalException(e);
} catch(SAXException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(XMLReader xmlReader, InputSource inputSource, Class clazz) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
SAXDocumentBuilder saxDocumentBuilder = new SAXDocumentBuilder();
xmlReader.setContentHandler(saxDocumentBuilder);
xmlReader.parse(inputSource);
return xmlToObject(new DOMRecord(saxDocumentBuilder.getDocument()), clazz);
} catch(IOException e) {
throw XMLMarshalException.unmarshalException(e);
} catch(SAXException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(InputSource inputSource) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = parser.parse(inputSource);
return xmlToObject(new DOMRecord(document));
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(Reader reader) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = parser.parse(reader);
return xmlToObject(new DOMRecord(document));
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(Reader reader, Class clazz) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = parser.parse(reader);
return xmlToObject(new DOMRecord(document), clazz);
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(Source source, Class clazz) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = parser.parse(source);
return xmlToObject(new DOMRecord(document), clazz);
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(URL url, Class clazz) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = parser.parse(url);
return xmlToObject(new DOMRecord(document), clazz);
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(File file) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = parser.parse(file);
return xmlToObject(new DOMRecord(document));
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(File file, Class clazz) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = parser.parse(file);
return xmlToObject(new DOMRecord(document), clazz);
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(InputStream inputStream) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = parser.parse(inputStream);
return xmlToObject(new DOMRecord(document));
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(InputSource inputSource, Class clazz) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = parser.parse(inputSource);
return xmlToObject(new DOMRecord(document), clazz);
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(URL url) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = parser.parse(url);
return xmlToObject(new DOMRecord(document));
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(InputStream inputStream, Class clazz) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = parser.parse(inputStream);
return xmlToObject(new DOMRecord(document), clazz);
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public Object unmarshal(Source source) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = parser.parse(source);
return xmlToObject(new DOMRecord(document));
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
@Override
public Object unmarshal(URL url, Class clazz) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = getParser().parse(url);
return xmlToObject(new DOMRecord(document), clazz);
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
@Override
public Object unmarshal(InputSource inputSource, Class clazz) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = getParser().parse(inputSource);
return xmlToObject(new DOMRecord(document), clazz);
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
@Override
public Object unmarshal(Source source, Class clazz) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = getParser().parse(source);
return xmlToObject(new DOMRecord(document), clazz);
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
@Override
public Object unmarshal(File file, Class clazz) {
if(!xmlUnmarshaller.isApplicationXML()){
throw XMLMarshalException.unsupportedMediaTypeForPlatform();
}
try {
Document document = null;
document = getParser().parse(file);
return xmlToObject(new DOMRecord(document), clazz);
} catch (XMLPlatformException e) {
throw XMLMarshalException.unmarshalException(e);
} finally {
xmlUnmarshaller.getStringBuffer().reset();
}
}
内容来源于网络,如有侵权,请联系作者删除!