org.eclipse.persistence.oxm.XMLUnmarshaller.isAutoDetectMediaType()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中org.eclipse.persistence.oxm.XMLUnmarshaller.isAutoDetectMediaType()方法的一些代码示例,展示了XMLUnmarshaller.isAutoDetectMediaType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLUnmarshaller.isAutoDetectMediaType()方法的具体详情如下:
包路径:org.eclipse.persistence.oxm.XMLUnmarshaller
类名称:XMLUnmarshaller
方法名:isAutoDetectMediaType

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);
  }
}

相关文章

XMLUnmarshaller类方法