}
public JavaInterfaceContract read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
// Read an <interface.java>
JavaInterfaceContract javaInterfaceContract = javaFactory.createJavaInterfaceContract();
String interfaceName = reader.getAttributeValue(null, INTERFACE);
if (interfaceName != null) {
JavaInterface javaInterface = createJavaInterface(interfaceName);
javaInterfaceContract.setInterface(javaInterface);
}
String callbackInterfaceName = reader.getAttributeValue(null, CALLBACK_INTERFACE);
if (callbackInterfaceName != null) {
JavaInterface javaCallbackInterface = createJavaInterface(callbackInterfaceName);
javaInterfaceContract.setCallbackInterface(javaCallbackInterface);
}
// Handle extended attributes
for (int a = 0; a < reader.getAttributeCount(); a++) {
QName attributeName = reader.getAttributeName(a);
if( attributeName.getNamespaceURI() != null && attributeName.getNamespaceURI().length() > 0) {
if( (! Constants.SCA10_NS.equals(attributeName.getNamespaceURI()) &&
(! Constants.SCA10_TUSCANY_NS.equals(attributeName.getNamespaceURI()) ))) {
Object attributeValue = extensionAttributeProcessor.read(attributeName, reader);
Extension attributeExtension;
if (attributeValue instanceof Extension) {
attributeExtension = (Extension) attributeValue;
} else {
attributeExtension = extensionFactory.createExtension(attributeName, attributeValue, true);
}
javaInterfaceContract.getAttributeExtensions().add(attributeExtension);
}
}
}
// Skip to end element
while (reader.hasNext()) {