ElementDescriptor[] desc = currentDescriptor.getElementDescriptors();
if (desc.length == 1) {
path = "*/"+desc[0].getQualifiedName();
}
}
Rule rule = new BeanCreateRule( childDescriptor, context, path, matchIDs);
addRule(path, rule);
continue;
}
if ( childDescriptor.getUpdater() != null ) {
if (log.isTraceEnabled()) {
log.trace("Element has updater "
+ ((MethodUpdater) childDescriptor.getUpdater()).getMethod().getName());
}
if ( childDescriptor.isPrimitiveType() ) {
addPrimitiveTypeRule(path, childDescriptor);
} else {
// add the first child to the path
ElementDescriptor[] grandChildren = childDescriptor.getElementDescriptors();
if ( grandChildren != null && grandChildren.length > 0 ) {
ElementDescriptor grandChild = grandChildren[0];
String grandChildQName = grandChild.getQualifiedName();
if ( grandChildQName != null && grandChildQName.length() > 0 ) {
if (childDescriptor.isWrapCollectionsInElement()) {
path += '/' + grandChildQName;
} else {
path = prefix + (prefix.endsWith("/")?"":"/") + grandChildQName;
}
}
}
// maybe we are adding a primitve type to a collection/array
Class beanClass = childDescriptor.getSingularPropertyType();
if ( XMLIntrospectorHelper.isPrimitiveType( beanClass ) ) {
addPrimitiveTypeRule(path, childDescriptor);
} else {
Rule rule = new BeanCreateRule(
childDescriptor,
context,
path + '/',
matchIDs );
addRule( path, rule );