ModuleIdentifier from XML element.
@param root The root element
@return ModuleIdentifier The name/version of the module
487074
protected static ModuleIdentifier getModuleIdentifier(final Element root) {
        return new ModuleIdentifier(root.getAttribute("name"), root.getAttribute("slot"), 
            Boolean.parseBoolean(root.getAttribute("optional")), Boolean.parseBoolean(root.getAttribute("export")));
    }
389454
public TreeNode getModuleTree(final String moduleId) {
        final ModuleHandler moduleHandler = new ModuleHandler(repoHandler);
        final DbModule module = moduleHandler.getModule(moduleId);

        final TreeNode tree = new TreeNode();
        tree.setName(module.getName());

        // Add submodules
        for (final DbModule submodule : module.getSubmodules()) {
            addModuleToTree(submodule, tree);
        }

        return tree;
    }
987816
public XMLNode parseXML(String root) {
        if (xmlElementsMap.containsKey(root)) {
            return xmlElementsMap.get(root);
        }
        try {
            currentRoot = root;
            isParsing = false;
            SAXParserFactory factory = SAXParserFactory.newInstance();
            SAXParser saxParser = factory.newSAXParser();
            InputStream in = configuration.getBuilderXML();
            saxParser.parse(in, this);
            return xmlElementsMap.get(root);
        } catch (Throwable t) {
            t.printStackTrace();
            throw new DocletAbortException(t);
        }
    }
1026394
public static PmiModuleConfig getConfig(String moduleID) {
        if (moduleID == null)
            return null;

        PmiModuleConfig config = (PmiModuleConfig) moduleConfigs.get(moduleID);

        if (config == null) {
            // beanModule and com.ibm.websphere.pmi.xml.beanModule will work
            // if moduleID doesn't have a '.' then use pre-defined modulePrefix
            int hasDot = moduleID.indexOf('.');
            if (hasDot == -1) {
                // not found in moduleConfigs; try as a pre-defined module
                // prepend com.ibm.websphere.pmi.xml. to moduleID
                String preDefinedMod = DEFAULT_MODULE_PREFIX + moduleID;
                config = getConfigFromXMLFile(getXmlFileName(preDefinedMod), true, false);
            }
        }

        if (config == null) {
            // input moduleID has '.' in it. use as it is            
            // do validation since its NOT pre-defined module
            config = getConfigFromXMLFile(getXmlFileName(moduleID), true, true);
        }

        return config;
    }
1312625
static public String getRootNodeName(String xml)
    {
        String rootNodeName = null;
        try {
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setExpandEntityReferences(false);
            DocumentBuilder dBuilder = dbf.newDocumentBuilder();
            InputSource inputSource = new InputSource(new StringReader(xml));
            Document doc = dBuilder.parse(inputSource);
            doc.getDocumentElement().normalize();
            rootNodeName = doc.getDocumentElement().getNodeName();
        } catch (SAXException e) {
            System.out.println("SAX exception: " + e);
        } catch (IOException e) {
            System.out.println("IO exception: " + e);
        } catch (ParserConfigurationException e) {
            System.out.println("ParserConfiguration exception: " + e);
        }
        return rootNodeName;
    }
1236051
public static ModuleIdentifier asModuleIdentifier(ModelNode value, ModuleIdentifier defaultValue) {
        return value.isDefined() ? ModuleIdentifier.fromString(value.asString()) : defaultValue;
    }
272034
public static ModuleIdentifier forFile(String filepath) {
    String normalizedName = ModuleNames.fileToModuleName(filepath);
    return new AutoValue_ModuleIdentifier(filepath, normalizedName, normalizedName);
  }
583001
@Override
    public Element getXML(Document root) {
        Element node = root.createElement("folder");
        this.addNodeAttributes(node);
        return node;
    }
614044
public static ModuleIdentifier createRevisionId(ModuleId scriptModuleId, long revisionNumber) {
        Objects.requireNonNull(scriptModuleId, "scriptModuleId");
        return ModuleIdentifier.create(scriptModuleId.toString(), Long.toString(revisionNumber));
    }
396187
public function toXml(\SimpleXMLElement $root) {
    	$propertyNode = $root->addChild("parameter");
    	$propertyNode->addAttribute("name", $this->getName());
    	$propertyNode->addAttribute("position", $this->getPosition());
    	$propertyNode->addAttribute("hasDefault", $this->isDefaultValueAvailable()?"true":"false");
    	if ($this->isDefaultValueAvailable()) {
			$propertyNode->addAttribute("default", serialize($this->getDefaultValue())); 
    	}
    	$propertyNode->addAttribute("isArray", $this->isArray()?"true":"false");
    	if ($this->getClass() != null) {
    		$propertyNode->addAttribute("class", $this->getClass()->getName());
    	}
    }
1232457
public static RootContainer getRootContainer(final EntityContainer container) {
	// Root must be identifable
	if (!(container instanceof Identifiable)) {
	    return null;
	}

	EntityContainer parent = container instanceof Entity ? ((Entity) container).getContainer() : null;
	UUID rootID = null;

	// Check not root
	if (parent == null) {
	    rootID = ((Identifiable) container).getID();
	}
	// Get parents root
	else if (container instanceof Taggable) {
	    final RootContainer parentRoot = ((Taggable) container).getSingletonTag(RootContainer.class);
	    if (parentRoot != null) {
		rootID = parentRoot.getValue();
	    }
	}

	// Find root
	if (rootID == null) {
	    // Get top level entity
	    while (parent instanceof Entity) {
		final Entity e = (Entity) parent;
		rootID = e.getID();
		parent = e.getContainer();
	    }
	    // Container root (null, container or JALSE)
	    if (!(parent instanceof Identifiable)) {
		return null;
	    }
	}

	return new RootContainer(rootID);
    }
854950
protected Collection<AbstractElement> getElementsToParse(AbstractElement root) {
		if (root instanceof Alternatives)
			return ((CompoundElement) root).getElements();
		return Collections.singleton(root);
	}
798575
public static Element getChild( Element root, String name )
    {
        if( null == root )
        {
            return null;
        }
        NodeList list = root.getElementsByTagName( name );
        int n = list.getLength();
        if( n < 1 )
        {
            return null;
        }
        return (Element) list.item( 0 );
    }
844688
private static IdentifierHandler<? extends Identifier> getExtendedIdentifierHandlerFor(Element element) {
		if (!checkExtendedIdentityElement(element)) {
			return null;
		}

		String name = element.getAttribute(IfmapStrings.IDENTITY_ATTR_NAME);

		Document extendedDocument;
		try {
			extendedDocument = DomHelpers.parseEscapedXmlString(name);
		} catch (UnmarshalException e) {
			return null;
		}
		Element extendedElement = extendedDocument.getDocumentElement();
		String nodeName = extendedElement.getLocalName();

		// try to find the most specific handler
		for (Entry<Class<? extends Identifier>, IdentifierHandler<? extends Identifier>> entry : sIdentifierHandlers
				.entrySet()) {

			String simpleClassName = entry.getKey().getSimpleName();

			if (simpleClassName.equalsIgnoreCase(nodeName)) {
				return entry.getValue();
			}
		}

		return null;
	}
625976
public static StrLookup newOgnlLookup(final Object root)
	{
		return new OgnlStrLookup(INSTANCE.getEvaluators(getRootClass(root)), root);
	}
574663
public java.lang.String getRootElement() {
        return (java.lang.String) getStateHelper().eval(PropertyKeys.rootElement);

    }
315159
public static SurfaceConfig imports(Xml root)
    {
        Check.notNull(root);

        final Xml node = root.getChild(NODE_SURFACE);
        final String surface = node.readString(ATT_IMAGE);
        final String icon = node.readString(null, ATT_ICON);

        return new SurfaceConfig(surface, icon);
    }