/**
* Process <import.resource uri="" location=""/>
*/
public ResourceImport read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException {
ResourceImport resourceImport = this.factory.createResourceImport();
QName element;
try {
while (reader.hasNext()) {
int event = reader.getEventType();
switch (event) {
case START_ELEMENT:
element = reader.getName();
// Read <import>
if (ResourceImport.TYPE.equals(element)) {
String uri = reader.getAttributeValue(null, URI);
if (uri == null) {
error(context.getMonitor(), "AttributeURIMissing", reader);
//throw new ContributionReadException("Attribute 'uri' is missing");
} else
resourceImport.setURI(uri);
String location = reader.getAttributeValue(null, LOCATION);
if (location != null) {
resourceImport.setLocation(location);
}
}
break;
case XMLStreamConstants.END_ELEMENT:
if (ResourceImport.TYPE.equals(reader.getName())) {