/** * INTERNAL * @since 2.5.0 */ @Override public UnmarshalRecord createUnmarshalRecord(DESCRIPTOR xmlDescriptor, ABSTRACT_SESSION session) { return (UnmarshalRecord) xmlDescriptor.getObjectBuilder().createRecord(session); }
/** * Return a new instance of the receiver's javaClass. */ @Override public Object buildNewInstance() { return this.descriptor.getInstantiationPolicy().buildNewInstance(); }
T value = getValueByXPath(object, descriptor.getObjectBuilder(), stringTokenizer, namespaceResolver, returnType); if (null == value) { CoreMapping selfMapping = descriptor.getObjectBuilder().getMappingForField(createField(String.valueOf(Constants.DOT))); if (null != selfMapping && selfMapping.getReferenceDescriptor() != null) { return getValueByXPath(selfMapping.getAttributeValueFromObject(object), selfMapping.getReferenceDescriptor().getObjectBuilder(),
field.setXPath(xPath + nextToken); field.initialize(); CoreMapping mapping = objectBuilder.getMappingForField(field); if (null == mapping) { field.setXPath(xPathNoIndexes); field.initialize(); mapping = objectBuilder.getMappingForField(field); if (null == mapping) { mapping = objectBuilder.getMappingForField(field); childObject = mapping.getReferenceDescriptor().getObjectBuilder().buildNewInstance(); childObject = mapping.getReferenceDescriptor().getObjectBuilder().buildNewInstance();
adapter = jaxbContext.getTypeMappingInfoToJavaTypeAdapters().get(type); UnmarshalRecord wrapper = (UnmarshalRecord) xmlDescriptor.getObjectBuilder().createRecordFromXMLContext(xmlUnmarshaller.getXMLContext()); org.eclipse.persistence.internal.oxm.record.UnmarshalRecord unmarshalRecord = wrapper.getUnmarshalRecord(); XMLStreamReaderReader staxReader = new XMLStreamReaderReader(xmlUnmarshaller);
descriptor.getInstantiationPolicy().useFactoryInstantiationPolicy(info.getObjectFactoryClassName(), info.getFactoryMethodName());
/** * Return a new instance of the receiver's javaClass. */ @Override public Object buildNewInstance() { return this.descriptor.getInstantiationPolicy().buildNewInstance(); }
field.setXPath(xPath + nextToken); field.initialize(); CoreMapping mapping = objectBuilder.getMappingForField(field); if (null == mapping) { field.setXPath(xPathNoIndexes); field.initialize(); mapping = objectBuilder.getMappingForField(field); if (null == mapping) { mapping = objectBuilder.getMappingForField(field); childObject = mapping.getReferenceDescriptor().getObjectBuilder().buildNewInstance(); childObject = mapping.getReferenceDescriptor().getObjectBuilder().buildNewInstance();
/** * INTERNAL * @since 2.5.0 */ @Override public UnmarshalRecord createUnmarshalRecord(DESCRIPTOR xmlDescriptor, ABSTRACT_SESSION session) { return (UnmarshalRecord) xmlDescriptor.getObjectBuilder().createRecord(session); }
T value = getValueByXPath(object, descriptor.getObjectBuilder(), stringTokenizer, namespaceResolver, returnType); if (null == value) { CoreMapping selfMapping = descriptor.getObjectBuilder().getMappingForField(createField(String.valueOf(Constants.DOT))); if (null != selfMapping && selfMapping.getReferenceDescriptor() != null) { return getValueByXPath(selfMapping.getAttributeValueFromObject(object), selfMapping.getReferenceDescriptor().getObjectBuilder(),
adapter = jaxbContext.getTypeMappingInfoToJavaTypeAdapters().get(type); UnmarshalRecord wrapper = (UnmarshalRecord) xmlDescriptor.getObjectBuilder().createRecordFromXMLContext(xmlUnmarshaller.getXMLContext()); org.eclipse.persistence.internal.oxm.record.UnmarshalRecord unmarshalRecord = (org.eclipse.persistence.internal.oxm.record.UnmarshalRecord) wrapper.getUnmarshalRecord(); XMLStreamReaderReader staxReader = new XMLStreamReaderReader(xmlUnmarshaller);
descriptor.getInstantiationPolicy().useFactoryInstantiationPolicy(info.getObjectFactoryClassName(), info.getFactoryMethodName());
private <T> T createByXPath(Object object, CoreObjectBuilder objectBuilder, StringTokenizer stringTokenizer, NAMESPACE_RESOLVER namespaceResolver, Class<T> returnType) { XPathQueryResult queryResult = getMappingForXPath(object, objectBuilder, stringTokenizer, namespaceResolver); if (null != queryResult.mapping) { DESCRIPTOR refDescriptor = (DESCRIPTOR) queryResult.mapping.getReferenceDescriptor(); if (null != refDescriptor) { return (T) refDescriptor.getInstantiationPolicy().buildNewInstance(); } } return null; }
private <T> T createByXPath(Object object, CoreObjectBuilder objectBuilder, StringTokenizer stringTokenizer, NAMESPACE_RESOLVER namespaceResolver, Class<T> returnType) { XPathQueryResult queryResult = getMappingForXPath(object, objectBuilder, stringTokenizer, namespaceResolver); if (null != queryResult.mapping) { DESCRIPTOR refDescriptor = (DESCRIPTOR) queryResult.mapping.getReferenceDescriptor(); if (null != refDescriptor) { return (T) refDescriptor.getInstantiationPolicy().buildNewInstance(); } } return 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); }
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); }