@Override public IConfigurationElement[] getChildren(String name) throws InvalidRegistryObjectException { List<XMLConfigElement> result = new ArrayList<XMLConfigElement>(); for (XMLConfigElement e : children) { if (name.equals(e.getName())) result.add(e); } return result.toArray(new XMLConfigElement[result.size()]); }
public XMLConfigElement(Object parent, String name) { this.parent = parent; if (parent instanceof XMLConfigElement) { ((XMLConfigElement) parent).children.add(this); } this.name = name; }
@Override public IConfigurationElement[] getConfigurationElements() throws InvalidRegistryObjectException { return root.getChildren(); }
@Override public IExtension getDeclaringExtension() throws InvalidRegistryObjectException { XMLConfigElement root = this; while (root.getParent() instanceof XMLConfigElement) root = (XMLConfigElement) root.getParent(); return new XMLExtension(root); }