/**
* Process <import namespace="" location=""/>
*/
public NamespaceImport read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException {
NamespaceImport namespaceImport = this.factory.createNamespaceImport();
QName element;
try {
while (reader.hasNext()) {
int event = reader.getEventType();
switch (event) {
case START_ELEMENT:
element = reader.getName();
// Read <import>
if (IMPORT.equals(element)) {
String ns = reader.getAttributeValue(null, NAMESPACE);
if (ns == null) {
error(context.getMonitor(), "AttributeNameSpaceMissing", reader);
//throw new ContributionReadException("Attribute 'namespace' is missing");
} else {
namespaceImport.setNamespace(ns);
}
String location = getURIString(reader, LOCATION);
if (location != null) {
namespaceImport.setLocation(location);
}
readExtendedAttributes(reader, namespaceImport, attributeProcessor, extensionFactory, context);
} else {
// handle extended elements
Object ext = extensionProcessor.read(reader, context);
if (namespaceImport != null) {
namespaceImport.getExtensions().add(ext);
}
}
break;
case XMLStreamConstants.END_ELEMENT:
if (IMPORT.equals(reader.getName())) {