public void writeSingleValue(Object value, Object parent, XMLRecord record, AbstractSession session) { Object element = value; if (hasValueConverter()) { if (getValueConverter() instanceof XMLConverter) { element = ((XMLConverter) getValueConverter()).convertObjectValueToDataValue(element, session, record.getMarshaller()); } else { element = getValueConverter().convertObjectValueToDataValue(element, session); } } record.add(this.getField(), element); }
public Converter getConverter(XMLField field) { if(null != this.fieldsToConverters) { Converter converter = fieldsToConverters.get(field); if(null != converter) { return converter; } if(null != this.choiceElementMappings) { DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field); if(null == mapping) { return null; } if(mapping.isAbstractCompositeDirectCollectionMapping()) { return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter(); } else if(mapping.isAbstractDirectMapping()) { return ((XMLDirectMapping)mapping).getConverter(); } } } return null; }
public Converter getConverter(XMLField field) { if(null != this.fieldsToConverters) { Converter converter = fieldsToConverters.get(field); if(null != converter) { return converter; } if(null != this.choiceElementMappings) { DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field); if(null == mapping) { return null; } if(mapping.isAbstractCompositeDirectCollectionMapping()) { return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter(); } else if(mapping.isAbstractDirectMapping()) { return ((XMLDirectMapping)mapping).getConverter(); } } } return null; }
public Converter getConverter(XMLField field) { if(null != this.fieldsToConverters) { Converter converter = fieldsToConverters.get(field); if(null != converter) { return converter; } if(null != this.choiceElementMappings) { DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field); if(null == mapping) { return null; } if(mapping.isAbstractCompositeDirectCollectionMapping()) { return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter(); } else if(mapping.isAbstractDirectMapping()) { return ((XMLDirectMapping)mapping).getConverter(); } } } return null; }
public Converter getConverter(XMLField field) { if(null != this.fieldsToConverters) { Converter converter = fieldsToConverters.get(field); if(null != converter) { return converter; } if(null != this.choiceElementMappings) { DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field); if(null == mapping) { return null; } if(mapping.isAbstractCompositeDirectCollectionMapping()) { return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter(); } else if(mapping.isAbstractDirectMapping()) { return ((XMLDirectMapping)mapping).getConverter(); } } } return null; }
public Converter getConverter(XMLField field) { if(null != this.fieldsToConverters) { Converter converter = fieldsToConverters.get(field); if(null != converter) { return converter; } if(null != this.choiceElementMappings) { DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field); if(null == mapping) { return null; } if(mapping.isAbstractCompositeDirectCollectionMapping()) { return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter(); } else if(mapping.isAbstractDirectMapping()) { return ((XMLDirectMapping)mapping).getConverter(); } } } return null; }
public Converter getConverter(XMLField field) { if(null != this.fieldsToConverters) { Converter converter = fieldsToConverters.get(field); if(null != converter) { return converter; } if(null != this.choiceElementMappings) { DatabaseMapping mapping = (DatabaseMapping) this.choiceElementMappings.get(field); if(null == mapping) { return null; } if(mapping.isAbstractCompositeDirectCollectionMapping()) { return ((XMLCompositeDirectCollectionMapping)mapping).getValueConverter(); } else if(mapping.isAbstractDirectMapping()) { return ((XMLDirectMapping)mapping).getConverter(); } } } return null; }
Object element = cp.next(iter, session); if (hasValueConverter()) { if (getValueConverter() instanceof XMLConverter) { element = ((XMLConverter) getValueConverter()).convertObjectValueToDataValue(element, session, ((XMLRecord) row).getMarshaller()); } else { element = getValueConverter().convertObjectValueToDataValue(element, session);
private void addUnmarshalValue(UnmarshalRecord unmarshalRecord, Object value, Object collection) { if (null == value) { return; } if (xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil() && xmlCompositeDirectCollectionMapping.getNullPolicy().valueIsNull(unmarshalRecord.getAttributes())) { return; } if ((!isWhitespaceAware() && XMLConstants.EMPTY_STRING.equals(value))) { return; } XMLField xmlField = (XMLField) xmlCompositeDirectCollectionMapping.getField(); XMLConversionManager xmlConversionManager = (XMLConversionManager) unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(); if (unmarshalRecord.getTypeQName() != null) { Class typeClass = xmlField.getJavaClass(unmarshalRecord.getTypeQName()); value = xmlConversionManager.convertObject(value, typeClass, unmarshalRecord.getTypeQName()); } else { value = xmlField.convertValueBasedOnSchemaType(value, xmlConversionManager, unmarshalRecord); } if (xmlCompositeDirectCollectionMapping.hasValueConverter()) { if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) { value = ((XMLConverter) xmlCompositeDirectCollectionMapping.getValueConverter()).convertDataValueToObjectValue(value, unmarshalRecord.getSession(), unmarshalRecord.getUnmarshaller()); } else { value = xmlCompositeDirectCollectionMapping.getValueConverter().convertDataValueToObjectValue(value, unmarshalRecord.getSession()); } } unmarshalRecord.addAttributeValue(this, value, collection); }
/** * INTERNAL: * Initialize the mapping. */ public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if (this.getField() instanceof XMLField && getValueConverter() instanceof TypeConversionConverter) { TypeConversionConverter converter = (TypeConversionConverter) getValueConverter(); this.getField().setType(converter.getObjectClass()); } ContainerPolicy cp = getContainerPolicy(); if (cp != null) { if (cp.getContainerClass() == null) { Class cls = session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(cp.getContainerClassName()); cp.setContainerClass(cls); } } ((XMLField) this.getField()).setIsCDATA(this.isCDATA()); }
Object element = stream.nextElement(); if (hasValueConverter()) { if (getValueConverter() instanceof XMLConverter) { element = ((XMLConverter) getValueConverter()).convertDataValueToObjectValue(element, executionSession, ((XMLRecord) row).getUnmarshaller()); } else { element = getValueConverter().convertDataValueToObjectValue(element, executionSession);
public boolean marshalSingleValue(XPathFragment xPathFragment, MarshalRecord marshalRecord, Object object, Object value, AbstractSession session, NamespaceResolver namespaceResolver, MarshalContext marshalContext) { if (xmlCompositeDirectCollectionMapping.hasValueConverter()) { if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) { value = ((XMLConverter) xmlCompositeDirectCollectionMapping.getValueConverter()).convertObjectValueToDataValue(value, session, marshalRecord.getMarshaller()); } else { value = xmlCompositeDirectCollectionMapping.getValueConverter().convertObjectValueToDataValue(value, session);
objectValue = cp.next(iterator, session); if (xmlCompositeDirectCollectionMapping.hasValueConverter()) { if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) { objectValue = ((XMLConverter) xmlCompositeDirectCollectionMapping.getValueConverter()).convertObjectValueToDataValue(objectValue, session, marshalRecord.getMarshaller()); } else { objectValue = xmlCompositeDirectCollectionMapping.getValueConverter().convertObjectValueToDataValue(objectValue, session);