configuration.addPlugInEventRepresentation(uriParsed, className, initializer);
}
private static void handlePlugInEventType(Configuration configuration, Element element)
{
DOMElementIterator nodeIterator = new DOMElementIterator(element.getChildNodes());
List<URI> uris = new ArrayList<URI>();
String name = getRequiredAttribute(element, "name");
String initializer = null;
while (nodeIterator.hasNext())
{
Element subElement = nodeIterator.next();
if (subElement.getNodeName().equals("resolution-uri"))
{
String uriValue = getRequiredAttribute(subElement, "value");
URI uri;
try
{
uri = new URI(uriValue);
}
catch (URISyntaxException ex)
{
throw new ConfigurationException("Error parsing URI '" + uriValue + "' as a valid java.net.URI string:" + ex.getMessage(), ex);
}
uris.add(uri);
}
if (subElement.getNodeName().equals("initializer"))
{
DOMElementIterator nodeIter = new DOMElementIterator(subElement.getChildNodes());
if (!nodeIter.hasNext())
{
throw new ConfigurationException("Error handling initializer for plug-in event type '" + name + "', no child node found under initializer element, expecting an element node");
}
StringWriter output = new StringWriter();
try
{
TransformerFactory.newInstance().newTransformer().transform(new DOMSource(nodeIter.next()), new StreamResult(output));
}
catch (TransformerException e)
{
throw new ConfigurationException("Error handling initializer for plug-in event type '" + name + "' :" + e.getMessage(), e);
}