return NodeConfiguration.class;
}
public NodeConfiguration read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
NodeConfiguration node = null;
ContributionConfiguration contribution = null;
DeploymentComposite composite = null;
BindingConfiguration binding = null;
// Skip to end element
while (true) {
int event = reader.getEventType();
switch (event) {
case XMLStreamConstants.START_ELEMENT:
QName name = reader.getName();
if (NODE.equals(name)) {
node = nodeConfigurationFactory.createNodeConfiguration();
node.setURI(reader.getAttributeValue(null, "uri"));
node.setDomainURI(reader.getAttributeValue(null, "domain"));
node.setDomainRegistryURI(reader.getAttributeValue(null, "domainRegistry"));
} else if (CONTRIBUTION.equals(name)) {
contribution = nodeConfigurationFactory.createContributionConfiguration();
contribution.setURI(reader.getAttributeValue(null, "uri"));
contribution.setLocation(reader.getAttributeValue(null, "location"));
contribution.setMetaDataURL(reader.getAttributeValue(null, "metaDataURL"));
String startDeployables = reader.getAttributeValue(null, "startDeployables");
if (startDeployables != null) {
contribution.setStartDeployables(Boolean.parseBoolean(startDeployables));
}
String dependentURIs = reader.getAttributeValue(null, "dependentURIs");
if (dependentURIs != null) {
contribution.setDependentContributionURIs(Arrays.asList(dependentURIs.split(",")));
}
node.getContributions().add(contribution);
} else if (BINDING.equals(name)) {
binding = nodeConfigurationFactory.createBindingConfiguration();
binding.setBindingType(getQName(reader, "name"));
String baseURIs = reader.getAttributeValue(null, "baseURIs");
if (baseURIs != null) {
StringTokenizer tokenizer = new StringTokenizer(baseURIs);
while (tokenizer.hasMoreTokens()) {
binding.getBaseURIs().add(tokenizer.nextToken());
}
}
node.getBindings().add(binding);
} else if (DEPLOYMENT_COMPOSITE.equals(name)) {
composite = nodeConfigurationFactory.createDeploymentComposite();
composite.setLocation(reader.getAttributeValue(null, "location"));
if (contribution != null) {
contribution.getDeploymentComposites().add(composite);
}
} else if(BASE_URI.equals(name)) {
// We also support <baseURI> element
String baseURI = reader.getElementText();
if (baseURI != null && binding != null) {
baseURI = baseURI.trim();
binding.addBaseURI(baseURI);
}
// getElementText() moves the event to END_ELEMENT
continue;
} else if (COMPOSITE.equals(name)) {
/*
Object model = processor.read(reader);
if (model instanceof Composite) {
// FIXME: We need to capture the text here
// composite.setComposite((Composite)model);
}
*/
StringWriter sw = new StringWriter();
XMLStreamWriter writer = helper.createXMLStreamWriter(sw);
helper.save(reader, writer);
composite.setContent(sw.toString());
} else {
node.getExtensions().add(processor.read(reader, context));
}
break;
case END_ELEMENT:
name = reader.getName();