public PluginDescriptorModel(PluginRegistryModel registry, XMLElement e) throws PluginException { this.registry = registry; id = getAttribute(e, "id", true); name = getAttribute(e, "name", true); providerName = getAttribute(e, "provider-name", false); version = getAttribute(e, "version", true); className = getAttribute(e, "class", false);  final ArrayList epList = new ArrayList(); final ArrayList exList = new ArrayList(); final ArrayList reqList = new ArrayList(); RuntimeModel runtime = null;  for (Iterator ci = e.getChildren().iterator(); ci.hasNext();) { final XMLElement childE = (XMLElement) ci.next(); final String tag = childE.getName(); if (tag.equals("extension-point")) { final ExtensionPoint ep = new ExtensionPointModel(this, childE); epList.add(ep); if (registry != null) { registry.registerExtensionPoint(ep); } } else if (tag.equals("requires")) { for (Iterator i = childE.getChildren().iterator(); i.hasNext();) { final XMLElement impE = (XMLElement) i.next(); if (impE.getName().equals("import")) { reqList.add(new PluginPrerequisiteModel(this, impE)); } else { throw new PluginException("Unknown element " + impE.getName()); } } } else if (tag.equals("extension")) { exList.add(new ExtensionModel(this, childE)); } else if (tag.equals("runtime")) { if (runtime == null) { runtime = new RuntimeModel(this, childE); } else { throw new PluginException("duplicate runtime element"); } } else { throw new PluginException("Unknown element " + tag); } } if (!epList.isEmpty()) { extensionPoints = (ExtensionPointModel[]) epList.toArray(new ExtensionPointModel[epList.size()]); } else { extensionPoints = new ExtensionPointModel[0]; }  if (!reqList.isEmpty()) { requires = (PluginPrerequisiteModel[]) reqList.toArray(new PluginPrerequisiteModel[reqList.size()]); } else { requires = new PluginPrerequisiteModel[0]; }  if (!exList.isEmpty()) { extensions = (ExtensionModel[]) exList.toArray(new ExtensionModel[exList.size()]); } else { extensions = new ExtensionModel[0]; }  this.runtime = runtime;
public PluginDescriptorModel(XMLElement e) throws PluginException { this(null, null, e);
	public PluginDescriptorModel(PluginRegistryModel registry, XMLElement e) throws PluginException {		this.registry = registry;		id = getAttribute(e, "id", true);		name = getAttribute(e, "name", true);		providerName = getAttribute(e, "provider-name", false);		version = getAttribute(e, "version", true);		className = getAttribute(e, "class", false);		final ArrayList epList = new ArrayList();		final ArrayList exList = new ArrayList();		final ArrayList reqList = new ArrayList();		RuntimeModel runtime = null;		for (Iterator ci = e.getChildren().iterator(); ci.hasNext();) {			final XMLElement childE = (XMLElement) ci.next();			final String tag = childE.getName();			if (tag.equals("extension-point")) {				final ExtensionPoint ep = new ExtensionPointModel(this, childE);				epList.add(ep);				if (registry != null) {					registry.registerExtensionPoint(ep);				}			} else if (tag.equals("requires")) {				for (Iterator i = childE.getChildren().iterator(); i.hasNext();) {					final XMLElement impE = (XMLElement) i.next();					if (impE.getName().equals("import")) {						reqList.add(new PluginPrerequisiteModel(this, impE));					} else {						throw new PluginException("Unknown element " + impE.getName());					}				}			} else if (tag.equals("extension")) {				exList.add(new ExtensionModel(this, childE));			} else if (tag.equals("runtime")) {				if (runtime == null) {					runtime = new RuntimeModel(this, childE);				} else {					throw new PluginException("duplicate runtime element");				}			} else {				throw new PluginException("Unknown element " + tag);			}		}		if (!epList.isEmpty()) {			extensionPoints = (ExtensionPointModel[]) epList.toArray(new ExtensionPointModel[epList.size()]);		} else {			extensionPoints = new ExtensionPointModel[0];		}		if (!reqList.isEmpty()) {			requires = (PluginPrerequisiteModel[]) reqList.toArray(new PluginPrerequisiteModel[reqList.size()]);		} else {			requires = new PluginPrerequisiteModel[0];		}		if (!exList.isEmpty()) {			extensions = (ExtensionModel[]) exList.toArray(new ExtensionModel[exList.size()]);		} else {			extensions = new ExtensionModel[0];		}		this.runtime = runtime;	}