protected void setOrAddAttributeValue(UnmarshalRecord unmarshalRecord, Object value, XPathFragment xPathFragment, Object collection){ unmarshalRecord.addAttributeValue(this, value, collection); }
public void endElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord) { SAXFragmentBuilder builder = unmarshalRecord.getFragmentBuilder(); Object value = builder.getNodes().remove(builder.getNodes().size() -1); unmarshalRecord.addAttributeValue(this, value); }
protected void setOrAddAttributeValueForKeepAsElement(SAXFragmentBuilder builder, XMLMapping mapping, XMLConverter converter, UnmarshalRecord unmarshalRecord, boolean isCollection, Object collection) { Object node = builder.getNodes().remove(builder.getNodes().size() -1); if (converter != null) { node = converter.convertDataValueToObjectValue(node, unmarshalRecord.getSession(), unmarshalRecord.getUnmarshaller()); } if (isCollection) { if(collection != null){ unmarshalRecord.addAttributeValue((ContainerValue) this, node, collection); }else{ unmarshalRecord.addAttributeValue((ContainerValue) this, node); } } else { unmarshalRecord.setAttributeValue(node, (DatabaseMapping) mapping); } }
private void startElementProcessText(UnmarshalRecord unmarshalRecord, Object collection) { String value = unmarshalRecord.getStringBuffer().toString(); unmarshalRecord.resetStringBuffer(); //if (!XMLConstants.EMPTY_STRING.equals(value) && xmlAnyCollectionMapping.isMixedContent()) { if (value.length() > 0 && xmlAnyCollectionMapping.isMixedContent()) { unmarshalRecord.addAttributeValue(this, value); } }
protected void setOrAddAttributeValue(UnmarshalRecord unmarshalRecord, Object value, XPathFragment xPathFragment, Object collection){ if (!xmlAnyCollectionMapping.usesXMLRoot()) { unmarshalRecord.addAttributeValue(this, value); } else { XMLRoot xmlRoot = new XMLRoot(); xmlRoot.setNamespaceURI(xPathFragment.getNamespaceURI()); xmlRoot.setSchemaType(unmarshalRecord.getTypeQName()); xmlRoot.setLocalName(xPathFragment.getLocalName()); xmlRoot.setObject(value); unmarshalRecord.addAttributeValue(this, xmlRoot); } }
record.addAttributeValue((ContainerValue)nodeValue, data);
objectValue = xmlAnyCollectionMapping.getConverter().convertDataValueToObjectValue(objectValue, unmarshalRecord.getSession(), unmarshalRecord.getUnmarshaller()); unmarshalRecord.addAttributeValue(this, objectValue); childObject = xmlAnyCollectionMapping.getConverter().convertDataValueToObjectValue(childObject, unmarshalRecord.getSession(), unmarshalRecord.getUnmarshaller()); unmarshalRecord.addAttributeValue(this, childObject);
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); }
unmarshalRecord.addAttributeValue(this, objectValue, collection);
if(isCollection) { if(value != null) { parent.addAttributeValue((ContainerValue)nodeValue, value);