private static XMLElement loadDeviceDescriptor(ClassLoader classLoader, String descriptorLocation) throws IOException { InputStream descriptor = classLoader.getResourceAsStream(descriptorLocation); if (descriptor == null) { throw new IOException("Cannot find descriptor at: " + descriptorLocation); } XMLElement doc; try { doc = loadXmlDocument(descriptor); } finally { IOUtils.closeQuietly(descriptor); } String parent = doc.getStringAttribute("extends"); if (parent != null) { return inheritXML(loadDeviceDescriptor(classLoader, expandResourcePath(besourceBase(descriptorLocation), parent)), doc, "/"); } return doc; }
parent.addChild(c); } else { inheritXML(p, c, fullName);