+ " [" + currStepValue.toString() + "]");
}
}
}
if (leafAttribute == null) {
AppSchemaAttributeBuilder builder = new AppSchemaAttributeBuilder(featureFactory);
if (crs != null) {
builder.setCRS(crs);
}
builder.setDescriptor(parent.getDescriptor());
// check for mapped type override
builder.setType(parent.getType());
if (targetNodeType != null) {
if (parent.getType().getName().equals(XSSchema.ANYTYPE_TYPE.getName())) {
// special handling for casting any type since there's no attributes in its
// schema
leafAttribute = builder.addAnyTypeValue(convertedValue, targetNodeType,
descriptor, id);
} else {
leafAttribute = builder.add(id, convertedValue, attributeName, targetNodeType);
}
} else if (descriptor.getType().getName().equals(XSSchema.ANYTYPE_TYPE.getName())
&& (value == null || (value instanceof Collection && ((Collection) value)
.isEmpty()))) {
// casting anyType as a complex attribute so we can set xlink:href
leafAttribute = builder.addComplexAnyTypeAttribute(convertedValue, descriptor, id);
} else {
leafAttribute = builder.add(id, convertedValue, attributeName);
}
if (index > -1) {
// set attribute index if specified so it can be retrieved later for grouping
leafAttribute.getUserData().put(ComplexFeatureConstants.MAPPED_ATTRIBUTE_INDEX,
index);