gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-20 02:29:40 27 4
gpt4 key购买 nike

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

XMLMarshaller.getAttachmentMarshaller介绍

暂无

代码示例

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

@Override
public AttachmentMarshaller getAttachmentMarshaller() {
  if (xmlMarshaller.getAttachmentMarshaller() == null) {
    return null;
  }
  return ((AttachmentMarshallerAdapter) xmlMarshaller.getAttachmentMarshaller()).getAttachmentMarshaller();
}

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

public AttachmentMarshaller getAttachmentMarshaller() {
  if (xmlMarshaller.getAttachmentMarshaller() == null) {
    return null;
  }
  return ((AttachmentMarshallerAdapter) xmlMarshaller.getAttachmentMarshaller()).getAttachmentMarshaller();
}

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

public void serialize(XMLDocument xmlDocument, OutputStream outputStream, Object options) throws IOException {
  XMLMarshaller xmlMarshaller = getXmlMarshaller();        
  XMLAttachmentMarshaller attachmentMarshaller = xmlMarshaller.getAttachmentMarshaller();
  //temporarily null out the attachment marshaller as it should not be used during serialization
  xmlMarshaller.setAttachmentMarshaller(null);
  OutputStreamWriter writer = new OutputStreamWriter(outputStream, xmlMarshaller.getEncoding());    	
  save(xmlDocument, writer, xmlMarshaller);        
  xmlMarshaller.setAttachmentMarshaller(attachmentMarshaller);
}

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

public void serialize(XMLDocument xmlDocument, OutputStream outputStream, Object options) throws IOException {
  XMLMarshaller xmlMarshaller = getXmlMarshaller();
  XMLAttachmentMarshaller attachmentMarshaller = xmlMarshaller.getAttachmentMarshaller();
  //temporarily null out the attachment marshaller as it should not be used during serialization
  xmlMarshaller.setAttachmentMarshaller(null);
  OutputStreamWriter writer = new OutputStreamWriter(outputStream, xmlMarshaller.getEncoding());
  save(xmlDocument, writer, xmlMarshaller);
  xmlMarshaller.setAttachmentMarshaller(attachmentMarshaller);
}

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

protected Node objectToXMLNode(Object object, Node rootNode, AbstractSession session,XMLDescriptor descriptor, boolean isXMLRoot) throws XMLMarshalException {
  DocumentPreservationPolicy docPresPolicy = xmlContext.getDocumentPreservationPolicy(session);
  if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) {
    XMLRecord xmlRow = null;
    if (!isXMLRoot) {
      xmlRow = (XMLRecord) ((XMLObjectBuilder) descriptor.getObjectBuilder()).createRecordFor(object, xmlContext.getDocumentPreservationPolicy(session));
      xmlRow.setMarshaller(this);
      if (getAttachmentMarshaller() != null) {
        xmlRow.setXOPPackage(getAttachmentMarshaller().isXOPPackage());
      }
      if (xmlRow.getDOM().getNodeType() == Node.ELEMENT_NODE) {
        addDescriptorNamespacesToXMLRecord(descriptor, xmlRow);
      }
    }
    Document doc = objectToXML(object, rootNode, descriptor, xmlRow, isXMLRoot, docPresPolicy);
    if ((xmlRow != null) && (xmlRow.getDOM().getNodeType() == Node.DOCUMENT_FRAGMENT_NODE)) {
      return xmlRow.getDOM();
    } else {
      return doc;
    }
  }
  MarshalRecord marshalRecord = new NodeRecord();
  marshalRecord.setMarshaller(this);
  marshalRecord.getNamespaceResolver().setDOM(rootNode);
  marshal(object, marshalRecord, session, descriptor, isXMLRoot);
  return marshalRecord.getDocument();
}

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

/**
* INTERNAL:
* Convert the given object to an XML Document
* @param object the object to marshal
* @return the document which the specified object has been marshalled to
* @param descriptor the XMLDescriptor for the object being marshalled
* @throws XMLMarshalException if an error occurred during marshalling
*/
protected Document objectToXML(Object object, XMLDescriptor descriptor, boolean isXMLRoot) throws XMLMarshalException {
  AbstractSession session = xmlContext.getSession(descriptor);
  DocumentPreservationPolicy docPresPolicy = xmlContext.getDocumentPreservationPolicy(session);
  if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) {
    XMLRecord xmlRow = null;
    if (!isXMLRoot) {
      xmlRow = (XMLRecord) ((XMLObjectBuilder) descriptor.getObjectBuilder()).createRecordFor(object, xmlContext.getDocumentPreservationPolicy(session));
      xmlRow.setMarshaller(this);
      if (getAttachmentMarshaller() != null) {
        xmlRow.setXOPPackage(getAttachmentMarshaller().isXOPPackage());
      }
      addDescriptorNamespacesToXMLRecord(descriptor, xmlRow);
    }
    return objectToXML(object, descriptor, xmlRow, isXMLRoot, docPresPolicy);
  }
  MarshalRecord marshalRecord = new NodeRecord();
  marshalRecord.setMarshaller(this);
  marshal(object, marshalRecord, session, descriptor, isXMLRoot);
  return marshalRecord.getDocument();
}

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

if (getAttachmentMarshaller() != null) {
  xmlRow.setXOPPackage(getAttachmentMarshaller().isXOPPackage());

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

XMLRecord xmlRow = (XMLRecord) ((XMLObjectBuilder) descriptor.getObjectBuilder()).createRecord(localRootName, parent, session);
xmlRow.setMarshaller(this);
if (getAttachmentMarshaller() != null) {
  xmlRow.setXOPPackage(getAttachmentMarshaller().isXOPPackage());

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

if (isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
    String id = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) element);
    element = id;
  } catch (ClassCastException cce) {
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0, bytes.length, this.mimeTypePolicy.getMimeType(parent), field.getLastXPathFragment().getLocalName(),
        field.getLastXPathFragment().getNamespaceURI());
  } else if (getAttributeElementClass() == XMLBinaryDataHelper.getXMLBinaryDataHelper().DATA_HANDLER) {
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment((DataHandler) element, field.getLastXPathFragment().getLocalName(), field.getLastXPathFragment().getNamespaceURI());
    if(c_id == null) {
      XMLBinaryDataHelper.EncodedData data = XMLBinaryDataHelper.getXMLBinaryDataHelper().getBytesForBinaryValue(element, marshaller, this.mimeTypePolicy.getMimeType(parent));
    XMLBinaryDataHelper.EncodedData data = XMLBinaryDataHelper.getXMLBinaryDataHelper().getBytesForBinaryValue(element, marshaller, this.mimeTypePolicy.getMimeType(parent));
    bytes = data.getData();
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0, bytes.length, data.getMimeType(), field.getLastXPathFragment().getLocalName(), field.getLastXPathFragment().getNamespaceURI());
} else if (isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
    String c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) element);
    element = c_id;
  } catch (Exception ex) {

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

if (isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
    String id = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) element);
    element = id;
  } catch (ClassCastException cce) {
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0, bytes.length, this.mimeTypePolicy.getMimeType(parent), field.getLastXPathFragment().getLocalName(),
        field.getLastXPathFragment().getNamespaceURI());
  } else if (getAttributeElementClass() == XMLBinaryDataHelper.getXMLBinaryDataHelper().DATA_HANDLER) {
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment((DataHandler) element, field.getLastXPathFragment().getLocalName(), field.getLastXPathFragment().getNamespaceURI());
    if(c_id == null) {
      XMLBinaryDataHelper.EncodedData data = XMLBinaryDataHelper.getXMLBinaryDataHelper().getBytesForBinaryValue(element, marshaller, this.mimeTypePolicy.getMimeType(parent));
    XMLBinaryDataHelper.EncodedData data = XMLBinaryDataHelper.getXMLBinaryDataHelper().getBytesForBinaryValue(element, marshaller, this.mimeTypePolicy.getMimeType(parent));
    bytes = data.getData();
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0, bytes.length, data.getMimeType(), field.getLastXPathFragment().getLocalName(), field.getLastXPathFragment().getNamespaceURI());
} else if (isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
    String c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) element);
    element = c_id;
  } catch (Exception ex) {

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

if (isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
    String id = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) element);
    element = id;
  } catch (ClassCastException cce) {
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0, bytes.length, this.mimeTypePolicy.getMimeType(parent), field.getLastXPathFragment().getLocalName(),
        field.getLastXPathFragment().getNamespaceURI());
  } else if (getCollectionContentType() == XMLBinaryDataHelper.getXMLBinaryDataHelper().DATA_HANDLER) {
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment((DataHandler) element, field.getLastXPathFragment().getLocalName(), field.getLastXPathFragment().getNamespaceURI());
    if(c_id == null) {
      XMLBinaryDataHelper.EncodedData data = XMLBinaryDataHelper.getXMLBinaryDataHelper().getBytesForBinaryValue(element, marshaller, this.mimeTypePolicy.getMimeType(parent));
    XMLBinaryDataHelper.EncodedData data = XMLBinaryDataHelper.getXMLBinaryDataHelper().getBytesForBinaryValue(element, marshaller, this.mimeTypePolicy.getMimeType(parent));
    bytes = data.getData();
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0, bytes.length, data.getMimeType(), field.getLastXPathFragment().getLocalName(), field.getLastXPathFragment().getNamespaceURI());
} else if (isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
    String c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) element);
    element = c_id;
  } catch (Exception ex) {

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

XMLField field = (XMLField) getField();
if (field.getLastXPathFragment().isAttribute()) {
  if (isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
        value = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) attributeValue);
      } else {
        value = marshaller.getAttachmentMarshaller().addSwaRefAttachment(bytes, 0, bytes.length);
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(//
        bytes, 0,//
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(//
        (DataHandler) attributeValue, elementName, namespaceUri);
    if(c_id == null) {
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0,//
} else if (isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
      c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) attributeValue);
    } else {
      c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment(bytes, 0, bytes.length);

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

if (xmlBinaryDataMapping.isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
    c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) objectValue);
    if(c_id == null) {
    c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment(bytes, 0, bytes.length);
  if (objectValue.getClass() == ClassConstants.APBYTE) {
    bytes = (byte[]) objectValue;
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0, bytes.length, this.xmlBinaryDataMapping.getMimeType(object), lastFrag.getLocalName(), lastFrag.getNamespaceURI());
  } else if (xmlBinaryDataMapping.getAttributeClassification() == XMLBinaryDataHelper.getXMLBinaryDataHelper().DATA_HANDLER) {
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment((DataHandler) objectValue, lastFrag.getLocalName(), lastFrag.getNamespaceURI());
    if(c_id == null) {
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0, bytes.length, data.getMimeType(), lastFrag.getLocalName(), lastFrag.getNamespaceURI());
  marshalRecord.closeStartElement();
if (xmlBinaryDataMapping.isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
  if(c_id != null) {
    marshalRecord.characters(c_id);

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

XMLField field = (XMLField) getField();
if (field.getLastXPathFragment().isAttribute()) {
  if (isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
        value = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) attributeValue);
      } else {
        value = marshaller.getAttachmentMarshaller().addSwaRefAttachment(bytes, 0, bytes.length);
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(//
        bytes, 0,//
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(//
        (DataHandler) attributeValue, elementName, namespaceUri);
    if(c_id == null) {
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0,//
} else if (isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
      c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) attributeValue);
    } else {
      c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment(bytes, 0, bytes.length);

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

marshalRecord.closeStartElement();
if (xmlBinaryDataCollectionMapping.isSwaRef() && marshaller.getAttachmentMarshaller() != null) {
    c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) objectValue);
    if(c_id == null) {
    c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment(bytes, 0, bytes.length);
    if (objectValue.getClass() == ClassConstants.APBYTE) {
      bytes = (byte[]) objectValue;
      c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0, bytes.length, this.xmlBinaryDataCollectionMapping.getMimeType(object), lastFrag.getLocalName(), lastFrag.getNamespaceURI());
    } else if (xmlBinaryDataCollectionMapping.getAttributeClassification() == XMLBinaryDataHelper.getXMLBinaryDataHelper().DATA_HANDLER) {
      c_id = marshaller.getAttachmentMarshaller().addMtomAttachment((DataHandler) objectValue, lastFrag.getLocalName(), lastFrag.getNamespaceURI());
      if(c_id == null) {
      c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0, bytes.length, //
          data.getMimeType(), lastFrag.getLocalName(), lastFrag.getNamespaceURI());

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

if (isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
        value = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) attributeValue);
      } else {
        value = marshaller.getAttachmentMarshaller().addSwaRefAttachment(bytes, 0, bytes.length);
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(//
        bytes, 0,//
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(//
        (DataHandler) attributeValue, field.getLastXPathFragment().getLocalName(), field.getLastXPathFragment().getNamespaceURI());
    if(c_id == null) {
    c_id = marshaller.getAttachmentMarshaller().addMtomAttachment(bytes, 0,//
} else if (isSwaRef() && (marshaller.getAttachmentMarshaller() != null)) {
      c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment((DataHandler) attributeValue);
    } else {
      c_id = marshaller.getAttachmentMarshaller().addSwaRefAttachment(bytes, 0, bytes.length);

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

if (getAttachmentMarshaller() != null) {
  marshalRecord.setXOPPackage(getAttachmentMarshaller().isXOPPackage());

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