public WebImplementation load(XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException {
Location startLocation = reader.getLocation();
URI uri = parseUri(reader, startLocation, context);
WebImplementation impl = new WebImplementation(uri);
validateAttributes(reader, context, impl);
for (WebImplementationIntrospector introspector : introspectors) {
introspector.introspect(impl, context);
}
try {
ComponentType type = impl.getComponentType();
ComponentType componentType = loadComponentType(context);
for (Map.Entry<String, ReferenceDefinition> entry : componentType.getReferences().entrySet()) {
type.add(entry.getValue());
}
for (Map.Entry<String, Property> entry : componentType.getProperties().entrySet()) {
type.add(entry.getValue());
}
} catch (LoaderException e) {
if (e.getCause() instanceof FileNotFoundException) {
} else {
ElementLoadFailure failure = new ElementLoadFailure("Error loading web.componentType", e, startLocation);
context.addError(failure);
return null;
}
}
LoaderUtil.skipToEndElement(reader);
return impl;
}