isFragment = canFragment(complex);
}
EventPropertyGetter getter = doResolvePropertyGetter(propertyName, true);
EventPropertyDescriptor desc = new EventPropertyDescriptor(propertyName, returnType, null, false, false, complex.isArray(), false, isFragment);
ExplicitPropertyDescriptor explicit = new ExplicitPropertyDescriptor(desc, getter, false, null);
additionalSchemaProps.add(explicit);
}
// Add a property for each simple child element
for (SchemaElementSimple simple : schemaModelRoot.getSimpleElements())
{
String propertyName = simple.getName();
Class returnType = SchemaUtil.toReturnType(simple);
EventPropertyGetter getter = doResolvePropertyGetter(propertyName, true);
EventPropertyDescriptor desc = new EventPropertyDescriptor(propertyName, returnType, null, false, false, simple.isArray(), false, false);
ExplicitPropertyDescriptor explicit = new ExplicitPropertyDescriptor(desc, getter, false, null);
additionalSchemaProps.add(explicit);
}
// Add a property for each attribute
for (SchemaItemAttribute attribute : schemaModelRoot.getAttributes())
{
String propertyName = attribute.getName();
Class returnType = SchemaUtil.toReturnType(attribute);
EventPropertyGetter getter = doResolvePropertyGetter(propertyName, true);
EventPropertyDescriptor desc = new EventPropertyDescriptor(propertyName, returnType, null, false, false, false, false, false);
ExplicitPropertyDescriptor explicit = new ExplicitPropertyDescriptor(desc, getter, false, null);
additionalSchemaProps.add(explicit);
}
// Finally add XPath properties as that may depend on the rootElementNamespace
super.initialize(config.getXPathProperties().values(), additionalSchemaProps);