gpt4 book ai didi

org.eclipse.persistence.exceptions.XMLMarshalException.unmarshalException()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 10:22:40 28 4
gpt4 key购买 nike

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

XMLMarshalException.unmarshalException介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

private EclipseLinkException convertSAXException(SAXException saxException) {
  Exception internalException = saxException.getException();
  if (internalException != null) {
    if (EclipseLinkException.class.isAssignableFrom(internalException.getClass())) {
      return (EclipseLinkException) internalException;
    } else {
      return XMLMarshalException.unmarshalException(internalException);
    }
  }
  return XMLMarshalException.unmarshalException(saxException);
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

private EclipseLinkException convertSAXException(SAXException saxException) {
  Exception internalException = saxException.getException();
  if (internalException != null) {
    if (EclipseLinkException.class.isAssignableFrom(internalException.getClass())) {
      return (EclipseLinkException) internalException;
    } else {
      return XMLMarshalException.unmarshalException(internalException);
    }
  }
  return XMLMarshalException.unmarshalException(saxException);
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

private EclipseLinkException convertSAXException(SAXException saxException) {
  Exception internalException = saxException.getException();
  if (internalException != null) {
    if (EclipseLinkException.class.isAssignableFrom(internalException.getClass())) {
      return (EclipseLinkException) internalException;
    } else {
      return XMLMarshalException.unmarshalException(internalException);
    }
  }
  return XMLMarshalException.unmarshalException(saxException);
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

private BufferedReader getBufferedReaderForInputSource(InputSource inputSource) {
  if (inputSource.getByteStream() != null) {
    return new BufferedReader(new InputStreamReader(inputSource.getByteStream()));
  } else if (inputSource.getCharacterStream() != null) {
    return new BufferedReader(inputSource.getCharacterStream());
  } else if (inputSource.getSystemId() != null) {
    InputStream is = getInputStreamFromString(inputSource.getSystemId());
    return new BufferedReader(new InputStreamReader(is));
  }
  throw XMLMarshalException.unmarshalException();
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

@Override
public void parse(String systemId) {
  try {
    parse(new InputSource(systemId));
  } catch (IOException | SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(URL url, Class clazz) {
  try {
    InputStream inputStream = url.openStream();
    Object result = unmarshal(inputStream, clazz);
    inputStream.close();
    return result;
  } catch (IOException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(XMLReader xmlReader, InputSource inputSource) {
  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);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(XMLReader xmlReader, InputSource inputSource, Class clazz) {
  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);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(File file, Class clazz) {
  try {
    if (xmlUnmarshaller.getXMLContext().hasDocumentPreservation()) {
      Node domElement = xmlParser.parse(file).getDocumentElement();
      return unmarshal(domElement, clazz);
    }
    FileInputStream inputStream = new FileInputStream(file);
    return unmarshal(inputStream, clazz);
  } catch (FileNotFoundException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(Reader reader, Class clazz) {
  try {
    Document document = null;
    document = parser.parse(reader);
    return xmlToObject(new DOMRecord(document), clazz);
  } catch (XMLPlatformException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(URL url) {
  try {
    Document document = null;
    document = parser.parse(url);
    return xmlToObject(new DOMRecord(document));
  } catch (XMLPlatformException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(URL url, Class clazz) {
  try {
    Document document = null;
    document = parser.parse(url);
    return xmlToObject(new DOMRecord(document), clazz);
  } catch (XMLPlatformException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(Reader reader) {
  try {
    Document document = null;
    document = parser.parse(reader);
    return xmlToObject(new DOMRecord(document));
  } catch (XMLPlatformException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(Source source, Class clazz) {
  try {
    Document document = null;
    document = parser.parse(source);
    return xmlToObject(new DOMRecord(document), clazz);
  } catch (XMLPlatformException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(InputSource inputSource, Class clazz) {
  try {
    Document document = null;
    document = parser.parse(inputSource);
    return xmlToObject(new DOMRecord(document), clazz);
  } catch (XMLPlatformException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(File file, Class clazz) {
  try {
    Document document = null;
    document = parser.parse(file);
    return xmlToObject(new DOMRecord(document), clazz);
  } catch (XMLPlatformException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(InputStream inputStream, Class clazz) {
  try {
    Document document = null;
    document = parser.parse(inputStream);
    return xmlToObject(new DOMRecord(document), clazz);
  } catch (XMLPlatformException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public Object unmarshal(InputSource inputSource) {
  try {
    Document document = null;
    document = parser.parse(inputSource);
    return xmlToObject(new DOMRecord(document));
  } catch (XMLPlatformException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

public boolean startElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord, Attributes atts) {
    try {
    processChild(xPathFragment, unmarshalRecord, atts, (Descriptor) getMapping().getReferenceDescriptor(), getMapping());
  } catch (SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
   return true;
 }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

public boolean startElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord, Attributes atts) {
    try {
    processChild(xPathFragment, unmarshalRecord, atts, (Descriptor) getMapping().getReferenceDescriptor(), getMapping());
  } catch (SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
   return true;
 }

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com