public class XplElementFactoryImpl implements XplElementFactory {
public XplElement createXplElement(QName type, Map<String, String> attributes) {
XplElement xplElement;
if (XplConstants.QNAME_PIPELINE.equals(type)) {
xplElement = new PipelineImpl();
} else if (XplConstants.QNAME_XSLT.equals(type)) {
xplElement = new XsltImpl();
} else if (XplConstants.QNAME_INPUT.equals(type)) {
xplElement = new InputImpl();
} else if (XplConstants.QNAME_DOCUMENT.equals(type)) {
xplElement = new DocumentImpl();
} else {
throw new IllegalArgumentException("An xpl element of type '" + type + "' could not be created.");
}
xplElement.setAttributes(attributes);
return xplElement;
}