if (childXMLType == null && fieldDesc != null && href == null) {
childXMLType = fieldDesc.getXmlType();
}
// Get Deserializer for child, default to using DeserializerImpl
Deserializer dSer = getDeserializer(childXMLType, propDesc.getType(),
href,
context);
// It is an error if the dSer is not found - the only case where we
// wouldn't have a deserializer at this point is when we're trying
// to deserialize something we have no clue about (no good xsi:type,
// no good metadata).
if (dSer == null) {
dSer = context.getDeserializerForClass(propDesc.getType());
}
// Fastpath nil checks...
if (context.isNil(attributes)) {
if (propDesc != null && propDesc.isIndexed()) {
if (!((dSer != null) && (dSer instanceof ArrayDeserializer)) ||
propDesc.getType().isArray()) {
collectionIndex++;
dSer.registerValueTarget(new BeanPropertyTarget(value,
propDesc, collectionIndex));
addChildDeserializer(dSer);
return (SOAPHandler)dSer;
}
}
return null;
}
if (dSer == null) {
throw new SAXException(Messages.getMessage("noDeser00",
childXMLType.toString()));
}
if (constructorToUse != null) {
if (constructorTarget == null) {
constructorTarget = new ConstructorTarget(constructorToUse, this);
}
dSer.registerValueTarget(constructorTarget);
} else if (propDesc.isWriteable()) { // Register value target
// If this is an indexed property, and the deserializer we found
// was NOT the ArrayDeserializer, this is a non-SOAP array:
// <bean>
// <field>value1</field>
// <field>value2</field>
// ...
// In this case, we want to use the collectionIndex and make sure
// the deserialized value for the child element goes into the
// right place in the collection.
if (propDesc.isIndexed() && (
!(dSer instanceof ArrayDeserializer) ||
propDesc.getType().isArray())) {
collectionIndex++;
dSer.registerValueTarget(new BeanPropertyTarget(value,
propDesc, collectionIndex));
} else {
// If we're here, the element maps to a single field value,
// whether that be a "basic" type or an array, so use the
// normal (non-indexed) BeanPropertyTarget form.
collectionIndex = -1;
dSer.registerValueTarget(new BeanPropertyTarget(value,
propDesc));
}
}
// Let the framework know that we need this deserializer to complete