gpt4 book ai didi

org.eclipse.persistence.internal.oxm.XMLConversionManager.convertSchemaBase64ToByteArray()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 12:04:40 25 4
gpt4 key购买 nike

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

XMLConversionManager.convertSchemaBase64ToByteArray介绍

[英]INTERNAL: Converts a String which is in Base64 format to a Byte[]
[中]内部:将Base64格式的字符串转换为字节[]

代码示例

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

protected Byte[] convertSchemaBase64ToByteObjectArray(Object sourceObject) throws ConversionException {
  byte[] bytes = convertSchemaBase64ToByteArray(sourceObject);
  Byte[] objectBytes = new Byte[bytes.length];
  for (int index = 0; index < bytes.length; index++) {
    objectBytes[index] = bytes[index];
  }
  return objectBytes;
}

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

protected Byte[] convertSchemaBase64ToByteObjectArray(Object sourceObject) throws ConversionException {
  byte[] bytes = convertSchemaBase64ToByteArray(sourceObject);
  Byte[] objectBytes = new Byte[bytes.length];
  for (int index = 0; index < bytes.length; index++) {
    objectBytes[index] = bytes[index];
  }
  return objectBytes;
}

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

protected Byte[] convertSchemaBase64ToByteObjectArray(Object sourceObject) throws ConversionException {
  byte[] bytes = convertSchemaBase64ToByteArray(sourceObject);
  Byte[] objectBytes = new Byte[bytes.length];
  for (int index = 0; index < bytes.length; index++) {
    objectBytes[index] = new Byte(bytes[index]);
  }
  return objectBytes;
}

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

public DataHandler convertObjectToDataHandler(Object sourceObject, AbstractSession session) {
  DataHandler handler = null;
  if (sourceObject instanceof DataHandler) {
    return (DataHandler) sourceObject;
  } else if (sourceObject instanceof byte[]) {
    byte[] bytes = (byte[]) sourceObject;
    handler = new DataHandler(new ByteArrayDataSource(bytes, "application/octet-stream"));
  } else if (sourceObject instanceof Byte[]) {
    byte[] bytes = (byte[]) session.getDatasourcePlatform().getConversionManager().convertObject(sourceObject, ClassConstants.APBYTE);
    handler = new DataHandler(new ByteArrayDataSource(bytes, "application/octet-stream"));
  }
  if (sourceObject instanceof String) {
    //assume base64 String
    byte[] bytes = ((XMLConversionManager) session.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(sourceObject);
    handler = new DataHandler(new ByteArrayDataSource(bytes, "application/octet-stream"));
  } else if (sourceObject instanceof Image) {
    handler = new DataHandler(sourceObject, "image/jpeg");
  } else if (sourceObject instanceof Source) {
    handler = new DataHandler(sourceObject, "text/xml");
  } else if (sourceObject instanceof MimeMultipart) {
    handler = new DataHandler(sourceObject, ((MimeMultipart) sourceObject).getContentType());
  }
  return handler;
}

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

return super.convertObjectToByteArray(sourceObject);
} else if (schemaTypeQName.getLocalPart().equalsIgnoreCase(XMLConstants.BASE_64_BINARY)) {
  return convertSchemaBase64ToByteArray(sourceObject);

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

return super.convertObjectToByteArray(sourceObject);
} else if (schemaTypeQName.getLocalPart().equalsIgnoreCase(Constants.BASE_64_BINARY)) {
  return convertSchemaBase64ToByteArray(sourceObject);

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

return super.convertObjectToByteArray(sourceObject);
} else if (schemaTypeQName.getLocalPart().equalsIgnoreCase(Constants.BASE_64_BINARY)) {
  return convertSchemaBase64ToByteArray(sourceObject);

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

} else if (!this.isSwaRef()) {
  byte[] bytes = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(element);
  fieldValue = bytes;
      fieldValue = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(fieldValue);
    fieldValue = record.get(XMLConstants.TEXT);
    fieldValue = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(fieldValue);

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

} else if (!this.isSwaRef()) {
  byte[] bytes = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(element);
  fieldValue = bytes;
      fieldValue = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(fieldValue);
    fieldValue = record.get(XMLConstants.TEXT);
    fieldValue = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(fieldValue);

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

} else if (!this.isSwaRef()) {
  byte[] bytes = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(element);
  fieldValue = bytes;
    fieldValue = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(fieldValue);
  fieldValue = record.get(XMLConstants.TEXT);
  fieldValue = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(fieldValue);

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

byte[] bytes = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(value);
fieldValue = bytes;
  fieldValue = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(fieldValue);
  fieldValue = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(fieldValue);
} else {
  fieldValue = new byte[0];

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

byte[] bytes = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(value);
fieldValue = bytes;
  fieldValue = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(fieldValue);
  fieldValue = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(fieldValue);
} else {
  fieldValue = new byte[0];

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

byte[] bytes = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(value);
fieldValue = bytes;
  fieldValue = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(fieldValue);
  fieldValue = ((XMLConversionManager) executionSession.getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(fieldValue);
} else {
  fieldValue = new byte[0];

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

/**
 * Handle swaRef and inline attribute cases.
 */
public void attribute(UnmarshalRecord unmarshalRecord, String URI, String localName, String value) {
  unmarshalRecord.removeNullCapableValue(this);
  XMLField xmlField = (XMLField) xmlBinaryDataMapping.getField();
  XPathFragment lastFragment = xmlField.getLastXPathFragment();
  
  Object fieldValue = null;
  if (xmlBinaryDataMapping.isSwaRef()) {
    if (unmarshalRecord.getUnmarshaller().getAttachmentUnmarshaller() != null) {
      if (xmlBinaryDataMapping.getAttributeClassification() == XMLBinaryDataHelper.getXMLBinaryDataHelper().DATA_HANDLER) {
        fieldValue = unmarshalRecord.getUnmarshaller().getAttachmentUnmarshaller().getAttachmentAsDataHandler(value);
      } else {
        fieldValue = unmarshalRecord.getUnmarshaller().getAttachmentUnmarshaller().getAttachmentAsByteArray(value);
      }
      xmlBinaryDataMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(), XMLBinaryDataHelper.getXMLBinaryDataHelper().convertObject(fieldValue, xmlBinaryDataMapping.getAttributeClassification(), unmarshalRecord.getSession()));
    }
  } else {
    // value should be base64 binary string
    fieldValue = ((XMLConversionManager) unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(value);
    xmlBinaryDataMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(), XMLBinaryDataHelper.getXMLBinaryDataHelper().convertObject(fieldValue, xmlBinaryDataMapping.getAttributeClassification(), unmarshalRecord.getSession()));
  }
}

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

fieldValue = ((XMLConversionManager) unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(value);
xmlBinaryDataCollectionMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(), XMLBinaryDataHelper.getXMLBinaryDataHelper().convertObject(fieldValue, xmlBinaryDataCollectionMapping.getAttributeClassification(),
    unmarshalRecord.getSession()));

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

value = XMLConversionManager.getDefaultXMLManager().convertSchemaBase64ToByteArray(value);
if (converter != null) {
  if (converter instanceof XMLConverter) {

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