modelFactories.getFactory(PolicyFactory.class), extensionProcessor, monitor);
}
public ComponentType read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
ComponentType componentType = null;
Service service = null;
Reference reference = null;
Contract contract = null;
Property property = null;
Callback callback = null;
QName name = null;
// Read the componentType document
while (reader.hasNext()) {
int event = reader.getEventType();
switch (event) {
case START_ELEMENT:
name = reader.getName();
if (Constants.COMPONENT_TYPE_QNAME.equals(name)) {
// Read a <componentType>
componentType = assemblyFactory.createComponentType();
componentType.setConstrainingType(readConstrainingType(reader));
} else if (Constants.SERVICE_QNAME.equals(name)) {
// Read a <service>
service = assemblyFactory.createService();
contract = service;
service.setName(getString(reader, Constants.NAME));
componentType.getServices().add(service);
policyProcessor.readPolicies(service, reader);
} else if (Constants.REFERENCE_QNAME.equals(name)) {