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; }
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; }
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; }
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; }
return super.convertObjectToByteArray(sourceObject); } else if (schemaTypeQName.getLocalPart().equalsIgnoreCase(XMLConstants.BASE_64_BINARY)) { return convertSchemaBase64ToByteArray(sourceObject);
return super.convertObjectToByteArray(sourceObject); } else if (schemaTypeQName.getLocalPart().equalsIgnoreCase(Constants.BASE_64_BINARY)) { return convertSchemaBase64ToByteArray(sourceObject);
return super.convertObjectToByteArray(sourceObject); } else if (schemaTypeQName.getLocalPart().equalsIgnoreCase(Constants.BASE_64_BINARY)) { return convertSchemaBase64ToByteArray(sourceObject);
} 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);
} 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);
} 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);
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];
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];
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];
/** * 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())); } }
fieldValue = ((XMLConversionManager) unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager()).convertSchemaBase64ToByteArray(value); xmlBinaryDataCollectionMapping.setAttributeValueInObject(unmarshalRecord.getCurrentObject(), XMLBinaryDataHelper.getXMLBinaryDataHelper().convertObject(fieldValue, xmlBinaryDataCollectionMapping.getAttributeClassification(), unmarshalRecord.getSession()));
value = XMLConversionManager.getDefaultXMLManager().convertSchemaBase64ToByteArray(value); if (converter != null) { if (converter instanceof XMLConverter) {