ClassDescriptor descriptor = nodeValue.getMapping().getReferenceDescriptor(); descriptor = nodeValue.getMapping().getDescriptor();
private Type getContainerType(final boolean isIndividual) { final XPathNodeWrapper currentNodeWrapper = getCurrentNodeWrapper(); if (currentNodeWrapper.nodeValue != null && currentNodeWrapper.nodeValue.isContainerValue()) { final DatabaseMapping mapping = currentNodeWrapper.nodeValue.getMapping(); Converter valueConverter = null; if (mapping != null) { if (isIndividual) { if (mapping instanceof AbstractCompositeDirectCollectionMapping) { valueConverter = ((AbstractCompositeDirectCollectionMapping) mapping).getValueConverter(); } else if (mapping instanceof XMLCompositeCollectionMapping) { valueConverter = ((XMLCompositeCollectionMapping) mapping).getConverter(); } } if (valueConverter instanceof TypeConversionConverter) { return ((TypeConversionConverter) valueConverter).getObjectClass(); } else if (mapping.getContainerPolicy() != null) { return mapping.getContainerPolicy().getContainerClass(); } } } return null; }
ClassDescriptor descriptor = nodeValue.getMapping().getReferenceDescriptor(); descriptor = nodeValue.getMapping().getDescriptor();
ClassDescriptor descriptor = nodeValue.getMapping().getReferenceDescriptor(); descriptor = nodeValue.getMapping().getDescriptor();
Mapping nextMapping = ((MappingNodeValue)nextNodeValue).getMapping(); if(nextMapping.isAbstractCompositeCollectionMapping()){ if(((CompositeCollectionMapping)nextMapping).getNullPolicy().isNullRepresentedByXsiNil()){
public void attribute(UnmarshalRecord unmarshalRecord, String namespaceURI, String localName, String value) { Descriptor referenceDescriptor = (Descriptor) getMapping().getReferenceDescriptor(); ObjectBuilder treeObjectBuilder = (ObjectBuilder) referenceDescriptor.getObjectBuilder(); MappingNodeValue textMappingNodeValue = (MappingNodeValue) treeObjectBuilder.getRootXPathNode().getTextNode().getNodeValue(); Mapping textMapping = textMappingNodeValue.getMapping(); Object childObject = referenceDescriptor.getInstantiationPolicy().buildNewInstance(); if(textMapping.isAbstractDirectMapping()) { DirectMapping xmlDirectMapping = (DirectMapping) textMappingNodeValue.getMapping(); Field xmlField = (Field) xmlDirectMapping.getField(); Object realValue = unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField, value, (ConversionManager) unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(), unmarshalRecord); Object convertedValue = xmlDirectMapping.getAttributeValue(realValue, unmarshalRecord.getSession(), unmarshalRecord); xmlDirectMapping.setAttributeValueInObject(childObject, convertedValue); } else { Object oldChildObject = unmarshalRecord.getCurrentObject(); CompositeObjectMapping nestedXMLCompositeObjectMapping = (CompositeObjectMapping) textMappingNodeValue.getMapping(); unmarshalRecord.setCurrentObject(childObject); textMappingNodeValue.attribute(unmarshalRecord, namespaceURI, localName, value); unmarshalRecord.setCurrentObject(oldChildObject); } setXPathInObject(namespaceURI, localName, childObject); setOrAddAttributeValue(unmarshalRecord, childObject, null, null); }
public void attribute(UnmarshalRecord unmarshalRecord, String namespaceURI, String localName, String value) { Descriptor referenceDescriptor = (Descriptor) getMapping().getReferenceDescriptor(); ObjectBuilder treeObjectBuilder = (ObjectBuilder) referenceDescriptor.getObjectBuilder(); MappingNodeValue textMappingNodeValue = (MappingNodeValue) treeObjectBuilder.getRootXPathNode().getTextNode().getNodeValue(); Mapping textMapping = textMappingNodeValue.getMapping(); Object childObject = referenceDescriptor.getInstantiationPolicy().buildNewInstance(); if(textMapping.isAbstractDirectMapping()) { DirectMapping xmlDirectMapping = (DirectMapping) textMappingNodeValue.getMapping(); Field xmlField = (Field) xmlDirectMapping.getField(); Object realValue = unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField, value, (ConversionManager) unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(), unmarshalRecord); Object convertedValue = xmlDirectMapping.getAttributeValue(realValue, unmarshalRecord.getSession(), unmarshalRecord); xmlDirectMapping.setAttributeValueInObject(childObject, convertedValue); } else { Object oldChildObject = unmarshalRecord.getCurrentObject(); CompositeObjectMapping nestedXMLCompositeObjectMapping = (CompositeObjectMapping) textMappingNodeValue.getMapping(); unmarshalRecord.setCurrentObject(childObject); textMappingNodeValue.attribute(unmarshalRecord, namespaceURI, localName, value); unmarshalRecord.setCurrentObject(oldChildObject); } setXPathInObject(namespaceURI, localName, childObject); setOrAddAttributeValue(unmarshalRecord, childObject, null, null); }
@Override public void attribute(UnmarshalRecord unmarshalRecord, String namespaceURI, String localName, String value) { unmarshalRecord.removeNullCapableValue(this); Descriptor referenceDescriptor = (Descriptor) getMapping().getReferenceDescriptor(); ObjectBuilder treeObjectBuilder = (ObjectBuilder) referenceDescriptor.getObjectBuilder(); MappingNodeValue textMappingNodeValue = (MappingNodeValue) treeObjectBuilder.getRootXPathNode().getTextNode().getNodeValue(); Mapping textMapping = textMappingNodeValue.getMapping(); Object childObject = referenceDescriptor.getInstantiationPolicy().buildNewInstance(); if(textMapping.isAbstractDirectMapping()) { DirectMapping xmlDirectMapping = (DirectMapping) textMappingNodeValue.getMapping(); Field xmlField = (Field) xmlDirectMapping.getField(); Object realValue = unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField, value, (ConversionManager) unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(), unmarshalRecord); Object convertedValue = xmlDirectMapping.getAttributeValue(realValue, unmarshalRecord.getSession(), unmarshalRecord); xmlDirectMapping.setAttributeValueInObject(childObject, convertedValue); } else { Object oldChildObject = unmarshalRecord.getCurrentObject(); CompositeObjectMapping nestedXMLCompositeObjectMapping = (CompositeObjectMapping) textMappingNodeValue.getMapping(); unmarshalRecord.setCurrentObject(childObject); textMappingNodeValue.attribute(unmarshalRecord, namespaceURI, localName, value); unmarshalRecord.setCurrentObject(oldChildObject); } setAttributeValue(childObject, unmarshalRecord); }
@Override public void attribute(UnmarshalRecord unmarshalRecord, String namespaceURI, String localName, String value) { unmarshalRecord.removeNullCapableValue(this); Descriptor referenceDescriptor = (Descriptor) getMapping().getReferenceDescriptor(); ObjectBuilder treeObjectBuilder = (ObjectBuilder) referenceDescriptor.getObjectBuilder(); MappingNodeValue textMappingNodeValue = (MappingNodeValue) treeObjectBuilder.getRootXPathNode().getTextNode().getNodeValue(); Mapping textMapping = textMappingNodeValue.getMapping(); Object childObject = referenceDescriptor.getInstantiationPolicy().buildNewInstance(); if(textMapping.isAbstractDirectMapping()) { DirectMapping xmlDirectMapping = (DirectMapping) textMappingNodeValue.getMapping(); Field xmlField = (Field) xmlDirectMapping.getField(); Object realValue = unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField, value, (ConversionManager) unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(), unmarshalRecord); Object convertedValue = xmlDirectMapping.getAttributeValue(realValue, unmarshalRecord.getSession(), unmarshalRecord); xmlDirectMapping.setAttributeValueInObject(childObject, convertedValue); } else { Object oldChildObject = unmarshalRecord.getCurrentObject(); CompositeObjectMapping nestedXMLCompositeObjectMapping = (CompositeObjectMapping) textMappingNodeValue.getMapping(); unmarshalRecord.setCurrentObject(childObject); textMappingNodeValue.attribute(unmarshalRecord, namespaceURI, localName, value); unmarshalRecord.setCurrentObject(oldChildObject); } setAttributeValue(childObject, unmarshalRecord); }
private Type getContainerType(final boolean isIndividual) { final XPathNodeWrapper currentNodeWrapper = getCurrentNodeWrapper(); if (currentNodeWrapper.nodeValue != null && currentNodeWrapper.nodeValue.isContainerValue()) { final DatabaseMapping mapping = currentNodeWrapper.nodeValue.getMapping(); Converter valueConverter = null; if (mapping != null) { if (isIndividual) { if (mapping instanceof AbstractCompositeDirectCollectionMapping) { valueConverter = ((AbstractCompositeDirectCollectionMapping) mapping).getValueConverter(); } else if (mapping instanceof XMLCompositeCollectionMapping) { valueConverter = ((XMLCompositeCollectionMapping) mapping).getConverter(); } } if (valueConverter instanceof TypeConversionConverter) { return ((TypeConversionConverter) valueConverter).getObjectClass(); } else if (mapping.getContainerPolicy() != null) { return mapping.getContainerPolicy().getContainerClass(); } } } return null; }
private Type getContainerType(final boolean isIndividual) { final XPathNodeWrapper currentNodeWrapper = getCurrentNodeWrapper(); if (currentNodeWrapper.nodeValue != null && currentNodeWrapper.nodeValue.isContainerValue()) { final DatabaseMapping mapping = currentNodeWrapper.nodeValue.getMapping(); Converter valueConverter = null; if (mapping != null) { if (isIndividual) { if (mapping instanceof AbstractCompositeDirectCollectionMapping) { valueConverter = ((AbstractCompositeDirectCollectionMapping) mapping).getValueConverter(); } else if (mapping instanceof XMLCompositeCollectionMapping) { valueConverter = ((XMLCompositeCollectionMapping) mapping).getConverter(); } } if (valueConverter instanceof TypeConversionConverter) { return ((TypeConversionConverter) valueConverter).getObjectClass(); } else if (mapping.getContainerPolicy() != null) { return mapping.getContainerPolicy().getContainerClass(); } } } return null; }
} else { if(marshalNodeValue.isMappingNodeValue()) { Mapping mapping = ((MappingNodeValue)marshalNodeValue).getMapping(); CoreAttributeGroup currentGroup = marshalRecord.getCurrentAttributeGroup(); if(!(currentGroup.containsAttributeInternal(mapping.getAttributeName()))) {
if (xPathNode.getNodeValue().isMappingNodeValue()) { MappingNodeValue mappingNodeValue = (MappingNodeValue) xPathNode.getNodeValue(); return mappingNodeValue.getMapping();
} else { if(marshalNodeValue.isMappingNodeValue()) { Mapping mapping = ((MappingNodeValue)marshalNodeValue).getMapping(); CoreAttributeGroup currentGroup = marshalRecord.getCurrentAttributeGroup(); if(!(currentGroup.containsAttributeInternal(mapping.getAttributeName()))) {
if (xPathNode.getNodeValue().isMappingNodeValue()) { MappingNodeValue mappingNodeValue = (MappingNodeValue) xPathNode.getNodeValue(); return mappingNodeValue.getMapping();
NodeValue marshalNodeValue = selfXPathNode.getMarshalNodeValue(); if(marshalNodeValue instanceof MappingNodeValue) { Mapping selfMapping = ((MappingNodeValue) marshalNodeValue).getMapping(); Object value = selfMapping.getAttributeValueFromObject(object); Descriptor referenceDescriptor = (Descriptor)selfMapping.getReferenceDescriptor();
NodeValue marshalNodeValue = selfXPathNode.getMarshalNodeValue(); if(marshalNodeValue instanceof MappingNodeValue) { Mapping selfMapping = ((MappingNodeValue) marshalNodeValue).getMapping(); Object value = selfMapping.getAttributeValueFromObject(object); Descriptor referenceDescriptor = (Descriptor)selfMapping.getReferenceDescriptor();
boolean isIncludedInAttributeGroup = true; if(unmarshalNodeValue.isMappingNodeValue()) { Mapping mapping = ((MappingNodeValue)unmarshalNodeValue).getMapping(); isIncludedInAttributeGroup = this.unmarshalAttributeGroup.containsAttributeInternal(mapping.getAttributeName()); if(textNode.isWhitespaceAware()){ if (textNodeUnmarshalNodeValue.isMappingNodeValue()) { Mapping mapping = ((MappingNodeValue)textNodeUnmarshalNodeValue).getMapping(); if(mapping.isAbstractDirectMapping() && isNil()) { Object nullValue = ((DirectMapping)mapping).getNullValue(); Mapping mapping = ((MappingNodeValue)textNodeUnmarshalNodeValue).getMapping(); if(mapping.isAbstractDirectMapping() && !isNil() && ((DirectMapping)mapping).getNullPolicy().isNullRepresentedByXsiNil()){ removeNullCapableValue((NullCapableValue)textNodeUnmarshalNodeValue);
ObjectBuilder tob = (ObjectBuilder) mapping.getReferenceDescriptor().getObjectBuilder(); MappingNodeValue textMappingNodeValue = (MappingNodeValue) tob.getRootXPathNode().getTextNode().getMarshalNodeValue(); Mapping textMapping = textMappingNodeValue.getMapping(); if(textMapping.isAbstractDirectMapping()) { DirectMapping xmlDirectMapping = (DirectMapping) textMapping;
ObjectBuilder tob = (ObjectBuilder) mapping.getReferenceDescriptor().getObjectBuilder(); MappingNodeValue textMappingNodeValue = (MappingNodeValue) tob.getRootXPathNode().getTextNode().getMarshalNodeValue(); Mapping textMapping = textMappingNodeValue.getMapping(); if(textMapping.isAbstractDirectMapping()) { DirectMapping xmlDirectMapping = (DirectMapping) textMapping;