Java Node.getNodeNameの例

プログラミング言語: Java
クラス/型: Node
メソッド/関数: getNodeName
hotexamples.comのコード掲載数: 30
Node.getNodeNameメソッドは、XMLノードの名前を取得するために使用されるJavaのメソッドです。このメソッドは、DOM(Document Object Model)ベースのXML処理で使用され、ノードのタグ名を返します。例えば、や<description>などのタグ名が返されることがあります。このメソッドは、XML文書内の特定のノードの名前を取得したい場合に便利です。</div> <strong>Java Node.getNodeName - 30件のコード例が見つかりました</strong>。すべてオープンソースプロジェクトから抽出されたJavaの<strong>Node.getNodeName</strong>の実例で、最も評価が高いものを厳選しています。コード例の評価を行っていただくことで、より質の高いコード例が表示されるようになります。 </div> </div> <div id="ezoic-pub-ad-placeholder-105"> <div style="text-align: center; margin-top: 10px"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- after-description --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="5330879504" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="visible-xs visible-sm visible-md"> <div class="bs-example thin" style="margin-top: 15px"> <div class="bs-example-title">よく使われるメソッド</div> <div class="fields-controls visible-sm visible-xs visible-md"> <a class="btn btn-default fields-show-btn" data-toggle="collapse" href="#fields-panel-mobile" aria-expanded="false" aria-controls="fields-panel">表示</a> <a class="btn btn-default fields-hide-btn" data-toggle="collapse" href="#fields-panel-mobile" aria-expanded="false" aria-controls="fields-panel">非表示</a> </div> </div> <figure class="highlight panel fields-panel collapse" id="fields-panel-mobile"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/appendChild/java-node-appendchild-method-examples.html">appendChild(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getData/java-node-getdata-method-examples.html">getData(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/item/java-node-item-method-examples.html">item(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/toString/java-node-tostring-method-examples.html">toString(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/left/java-node-left-method-examples.html">left(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/equals/java-node-equals-method-examples.html">equals(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getAttributes/java-node-getattributes-method-examples.html">getAttributes(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNodeValue/java-node-getnodevalue-method-examples.html">getNodeValue(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNodeType/java-node-getnodetype-method-examples.html">getNodeType(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/addChild/java-node-addchild-method-examples.html">addChild(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html">getNodeName(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/prev/java-node-prev-method-examples.html">prev(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getParent/java-node-getparent-method-examples.html">getParent(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getFirstChild/java-node-getfirstchild-method-examples.html">getFirstChild(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/next/java-node-next-method-examples.html">next(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getLeft/java-node-getleft-method-examples.html">getLeft(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getType/java-node-gettype-method-examples.html">getType(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNextSibling/java-node-getnextsibling-method-examples.html">getNextSibling(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getRight/java-node-getright-method-examples.html">getRight(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setNext/java-node-setnext-method-examples.html">setNext(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/data/java-node-data-method-examples.html">data(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getName/java-node-getname-method-examples.html">getName(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getValue/java-node-getvalue-method-examples.html">getValue(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getChildren/java-node-getchildren-method-examples.html">getChildren(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getChildNodes/java-node-getchildnodes-method-examples.html">getChildNodes(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/parent/java-node-parent-method-examples.html">parent(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setParent/java-node-setparent-method-examples.html">setParent(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getId/java-node-getid-method-examples.html">getId(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/right/java-node-right-method-examples.html">right(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNext/java-node-getnext-method-examples.html">getNext(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/value/java-node-value-method-examples.html">value(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getChild/java-node-getchild-method-examples.html">getChild(30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/previous/java-node-previous-method-examples.html">previous(29)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setRight/java-node-setright-method-examples.html">setRight(28)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/isLeaf/java-node-isleaf-method-examples.html">isLeaf(27)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getParentNode/java-node-getparentnode-method-examples.html">getParentNode(25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getTextContent/java-node-gettextcontent-method-examples.html">getTextContent(25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/accept/java-node-accept-method-examples.html">accept(25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setLeft/java-node-setleft-method-examples.html">setLeft(25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/update/java-node-update-method-examples.html">update(25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/leftChild/java-node-leftchild-method-examples.html">leftChild(22)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/get/java-node-get-method-examples.html">get(22)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/add/java-node-add-method-examples.html">add(21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNextNode/java-node-getnextnode-method-examples.html">getNextNode(21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/rightChild/java-node-rightchild-method-examples.html">rightChild(21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getRightChild/java-node-getrightchild-method-examples.html">getRightChild(21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/query/java-node-query-method-examples.html">query(21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getLeftChild/java-node-getleftchild-method-examples.html">getLeftChild(21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setValue/java-node-setvalue-method-examples.html">setValue(20)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/put/java-node-put-method-examples.html">put(20)</a> </div> </figure> </div> </div> <div class="page-content-container"> <div class="sidebar hidden-xs hidden-sm hidden-md" style="width:300px"> <div id="ezoic-pub-ad-placeholder-101"> <div style="text-align: center; margin-top: 10px"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- left-sidebar-1 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="7161345231" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="bs-example thin"> <div class="bs-example-title"> よく使われるメソッド </div> </div> <figure class="highlight panel fields-panel " id="fields-panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/appendChild/java-node-appendchild-method-examples.html">appendChild (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getData/java-node-getdata-method-examples.html">getData (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/item/java-node-item-method-examples.html">item (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/toString/java-node-tostring-method-examples.html">toString (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/left/java-node-left-method-examples.html">left (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/equals/java-node-equals-method-examples.html">equals (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getAttributes/java-node-getattributes-method-examples.html">getAttributes (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNodeValue/java-node-getnodevalue-method-examples.html">getNodeValue (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNodeType/java-node-getnodetype-method-examples.html">getNodeType (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/addChild/java-node-addchild-method-examples.html">addChild (30)</a> </div> </figure> <div id="ezoic-pub-ad-placeholder-102"> <div style="text-align: center; margin-bottom: 10px"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- left-sidebar-2 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="7075206013" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="bs-example thin"> <div class="bs-example-title"> よく使われるメソッド </div> </div> <figure class="highlight panel fields-panel " id="fields-panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html">getNodeName (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/prev/java-node-prev-method-examples.html">prev (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getParent/java-node-getparent-method-examples.html">getParent (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getFirstChild/java-node-getfirstchild-method-examples.html">getFirstChild (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/next/java-node-next-method-examples.html">next (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getLeft/java-node-getleft-method-examples.html">getLeft (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getType/java-node-gettype-method-examples.html">getType (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNextSibling/java-node-getnextsibling-method-examples.html">getNextSibling (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getRight/java-node-getright-method-examples.html">getRight (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setNext/java-node-setnext-method-examples.html">setNext (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/data/java-node-data-method-examples.html">data (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getName/java-node-getname-method-examples.html">getName (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getValue/java-node-getvalue-method-examples.html">getValue (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getChildren/java-node-getchildren-method-examples.html">getChildren (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getChildNodes/java-node-getchildnodes-method-examples.html">getChildNodes (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/parent/java-node-parent-method-examples.html">parent (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setParent/java-node-setparent-method-examples.html">setParent (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getId/java-node-getid-method-examples.html">getId (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/right/java-node-right-method-examples.html">right (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNext/java-node-getnext-method-examples.html">getNext (30)</a> </div> </figure> <div class="bs-example thin"> <div class="bs-example-title"> よく使われるメソッド </div> </div> <figure class="highlight panel fields-panel " id="fields-panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/data/java-node-data-method-examples.html">data (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getName/java-node-getname-method-examples.html">getName (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getValue/java-node-getvalue-method-examples.html">getValue (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getChildren/java-node-getchildren-method-examples.html">getChildren (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getChildNodes/java-node-getchildnodes-method-examples.html">getChildNodes (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/parent/java-node-parent-method-examples.html">parent (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setParent/java-node-setparent-method-examples.html">setParent (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getId/java-node-getid-method-examples.html">getId (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/right/java-node-right-method-examples.html">right (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNext/java-node-getnext-method-examples.html">getNext (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/value/java-node-value-method-examples.html">value (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getChild/java-node-getchild-method-examples.html">getChild (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/previous/java-node-previous-method-examples.html">previous (29)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setRight/java-node-setright-method-examples.html">setRight (28)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/isLeaf/java-node-isleaf-method-examples.html">isLeaf (27)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getParentNode/java-node-getparentnode-method-examples.html">getParentNode (25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getTextContent/java-node-gettextcontent-method-examples.html">getTextContent (25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/accept/java-node-accept-method-examples.html">accept (25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setLeft/java-node-setleft-method-examples.html">setLeft (25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/update/java-node-update-method-examples.html">update (25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/leftChild/java-node-leftchild-method-examples.html">leftChild (22)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/get/java-node-get-method-examples.html">get (22)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/add/java-node-add-method-examples.html">add (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNextNode/java-node-getnextnode-method-examples.html">getNextNode (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/rightChild/java-node-rightchild-method-examples.html">rightChild (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getRightChild/java-node-getrightchild-method-examples.html">getRightChild (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/query/java-node-query-method-examples.html">query (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getLeftChild/java-node-getleftchild-method-examples.html">getLeftChild (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setValue/java-node-setvalue-method-examples.html">setValue (20)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/put/java-node-put-method-examples.html">put (20)</a> </div> </figure> <div class="hidden-xs hidden-sm"> <div class="bs-example thin"> <div class="bs-example-title">Related in langs</div> </div> <figure class="highlight panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/jp/examples/-/-/cde_scripts_styles/php-cde_scripts_styles-function-examples.html">cde_scripts_styles (PHP)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://hotexamples.com/jp/examples/shopware.recovery.install.struct/ShopwareEdition/-/php-shopwareedition-class-examples.html">ShopwareEdition (PHP)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/jp/examples/-/BaseDataSet/-/php-basedataset-class-examples.html">BaseDataSet (C#)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://csharp.hotexamples.com/jp/examples/SocialNetwork.Domain/User/-/php-user-class-examples.html">User (C#)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://cpp.hotexamples.com/jp/examples/-/-/TFGameRules/cpp-tfgamerules-function-examples.html">TFGameRules (C++)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://cpp.hotexamples.com/jp/examples/-/-/switch_core_session_rwunlock/cpp-switch_core_session_rwunlock-function-examples.html">switch_core_session_rwunlock (C++)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://golang.hotexamples.com/jp/examples/c/-/xmlMemBlocks/golang-xmlmemblocks-function-examples.html">xmlMemBlocks (Go)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://golang.hotexamples.com/jp/examples/github.com.heroku.lumbermill.godeps._workspace.src.github.com.rcrowley.go-metrics/-/NewUniformSample/golang-newuniformsample-function-examples.html">NewUniformSample (Go)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://python.hotexamples.com/jp/examples/options/-/get_locale/python-get_locale-function-examples.html">get_locale (Python)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://python.hotexamples.com/jp/examples/ytutils/-/clean_up_title/python-clean_up_title-function-examples.html">clean_up_title (Python)</a> </div> </figure> </div> <div class="bs-example thin"> <div class="bs-example-title"> よく使われるメソッド </div> </div> <figure class="highlight panel fields-panel fields-panel-last" id="fields-panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/value/java-node-value-method-examples.html">value (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getChild/java-node-getchild-method-examples.html">getChild (30)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/previous/java-node-previous-method-examples.html">previous (29)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setRight/java-node-setright-method-examples.html">setRight (28)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/isLeaf/java-node-isleaf-method-examples.html">isLeaf (27)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getParentNode/java-node-getparentnode-method-examples.html">getParentNode (25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getTextContent/java-node-gettextcontent-method-examples.html">getTextContent (25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/accept/java-node-accept-method-examples.html">accept (25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setLeft/java-node-setleft-method-examples.html">setLeft (25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/update/java-node-update-method-examples.html">update (25)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/leftChild/java-node-leftchild-method-examples.html">leftChild (22)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/get/java-node-get-method-examples.html">get (22)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/add/java-node-add-method-examples.html">add (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getNextNode/java-node-getnextnode-method-examples.html">getNextNode (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/rightChild/java-node-rightchild-method-examples.html">rightChild (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getRightChild/java-node-getrightchild-method-examples.html">getRightChild (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/query/java-node-query-method-examples.html">query (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getLeftChild/java-node-getleftchild-method-examples.html">getLeftChild (21)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/setValue/java-node-setvalue-method-examples.html">setValue (20)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/put/java-node-put-method-examples.html">put (20)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/removeChild/java-node-removechild-method-examples.html">removeChild (19)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getKey/java-node-getkey-method-examples.html">getKey (19)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/commit/java-node-commit-method-examples.html">commit (19)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getLocalName/java-node-getlocalname-method-examples.html">getLocalName (18)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getElement/java-node-getelement-method-examples.html">getElement (18)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/addNode/java-node-addnode-method-examples.html">addNode (18)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/remove/java-node-remove-method-examples.html">remove (18)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/numChildren/java-node-numchildren-method-examples.html">numChildren (18)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/delete/java-node-delete-method-examples.html">delete (18)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getID/java-node-getid-method-examples.html">getID (18)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getX/java-node-getx-method-examples.html">getX (17)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getY/java-node-gety-method-examples.html">getY (17)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/size/java-node-size-method-examples.html">size (16)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/height/java-node-height-method-examples.html">height (16)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/N/java-node-n-method-examples.html">N (15)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getClass/java-node-getclass-method-examples.html">getClass (15)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getOwnerDocument/java-node-getownerdocument-method-examples.html">getOwnerDocument (15)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getPosition/java-node-getposition-method-examples.html">getPosition (15)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getBody/java-node-getbody-method-examples.html">getBody (15)</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/-/Node/getPrev/java-node-getprev-method-examples.html">getPrev (13)</a> </div> </figure> <div class="hidden-xs hidden-sm"> <div class="bs-example thin"> <div class="bs-example-title">関連情報</div> </div> <figure class="highlight panel"> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/java.math/CodLookupControl/-/java-codlookupcontrol-class-examples.html">CodLookupControl</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/org.jclouds.dynect.v3/DynECTApi/-/java-dynectapi-class-examples.html">DynECTApi</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/ontology.sprites/NoSuchMethodException/-/java-nosuchmethodexception-class-examples.html">NoSuchMethodException</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/com.sun.tools.javac.code.symbol/PackageSymbol/-/java-packagesymbol-class-examples.html">PackageSymbol</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/com.happy.home.database/DatabaseHelper/-/java-databasehelper-class-examples.html">DatabaseHelper</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/com.buschmais.jqassistant.core.analysis.api.rule/Group/-/java-group-class-examples.html">Group</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/org.geotools.test/OnlineTestCase/-/java-onlinetestcase-class-examples.html">OnlineTestCase</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/net.sourceforge.msscodefactory.cfinternet.v2_5.cfinternet/CFBamXMsgRspnHandler/-/java-cfbamxmsgrspnhandler-class-examples.html">CFBamXMsgRspnHandler</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/org.eclipse.emf.compare.tests.framework.junit.annotation/MatchTest/-/java-matchtest-class-examples.html">MatchTest</a> </div> <div style="overflow: hidden;text-overflow: ellipsis;"> <a href="https://java.hotexamples.com/jp/examples/com.intellij.psi/LambdaCanBeMethodReferenceInspection/-/java-lambdacanbemethodreferenceinspection-class-examples.html">LambdaCanBeMethodReferenceInspection</a> </div> </figure> </div> </div> <div class="main-content"> <div class="addthis_inline_share_toolbox_o6yp"></div> <div class="example-item" id="0x318b71f294d2e50a4cb744391fce444f5961cecbcc12641a9f0a33cf9b2803b6-294,,325,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #1</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_1" data-hash="0x318b71f294d2e50a4cb744391fce444f5961cecbcc12641a9f0a33cf9b2803b6" data-area="294,,325,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '1')" class="rating-up btn btn-success" data-id="rating_1"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'1')" class="rating-down btn btn-danger" data-id="rating_1"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x318b71f294d2e50a4cb744391fce444f5961cecbcc12641a9f0a33cf9b2803b6-294,,325,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x318b71f294d2e50a4cb744391fce444f5961cecbcc12641a9f0a33cf9b2803b6&fullName=neuroConstruct_1.6.0%2Fsrc%2Fucl%2Fphysiol%2Fneuroconstruct%2FXMLUtils.java&project=ChristophMetzner%2FROB-SS14-BachProj')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FChristophMetzner%2FROB-SS14-BachProj%2Fblob%2Fmaster%2FneuroConstruct_1.6.0%2Fsrc%2Fucl%2Fphysiol%2Fneuroconstruct%2FXMLUtils.java">XMLUtils.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FChristophMetzner%2FROB-SS14-BachProj">ChristophMetzner/ROB-SS14-BachProj</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="1"> <pre class="line-numbers language-java" data-end="325" data-start="295" data-highlight="303,304"> // Gets the specified XML Schema doc if one is mentioned in the file public static File getSchemaFile(Document xmlDoc) { /** @todo Must be an easier way of doing this... */ logger.logComment("Getting schema file for: " + xmlDoc.getDocumentURI()); NodeList nl = xmlDoc.getChildNodes(); for (int j = 0; j < nl.getLength(); j++) { Node node = nl.item(j); logger.logComment("Type: " + node.getNodeType() + "Name: " + node.getNodeName()); if (node.getNodeName().equals(XML_STYLESHEET_NODE)) { String nodeVal = node.getNodeValue(); logger.logComment("Looking at: " + nodeVal); String xslFileName = nodeVal.substring(nodeVal.indexOf("href=\"") + 6, nodeVal.length() - 1); File xslFile = new File(xslFileName); return xslFile; } if (node.getAttributes().getLength() > 0) { logger.logComment("Attributes: " + node.getAttributes()); if (node.getAttributes().getNamedItem(XML_SCHEMA_LOC_ATTR) != null) { String locString = node.getAttributes().getNamedItem(XML_SCHEMA_LOC_ATTR).getNodeValue(); logger.logComment("Loc string: " + locString); String file = locString.split("\\s")[1]; return new File(file); } } } logger.logError("No node found with name: " + XML_STYLESHEET_NODE); return null; }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-107"> <div style="text-align: center;margin-bottom: 10px"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- after-example-1 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="4981531786" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="example-item" id="0x72e3f7fbb50d0f3e27239ee12ec646cc2b8438fecb2c573b16225351ab0ba4db-53,,83,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #2</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_2" data-hash="0x72e3f7fbb50d0f3e27239ee12ec646cc2b8438fecb2c573b16225351ab0ba4db" data-area="53,,83,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '2')" class="rating-up btn btn-success" data-id="rating_2"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'2')" class="rating-down btn btn-danger" data-id="rating_2"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x72e3f7fbb50d0f3e27239ee12ec646cc2b8438fecb2c573b16225351ab0ba4db-53,,83,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x72e3f7fbb50d0f3e27239ee12ec646cc2b8438fecb2c573b16225351ab0ba4db&fullName=trunk%2Fserver%2Fsrc%2Forg%2Flucane%2Fserver%2Fstore%2FLdapConfig.java&project=BackupTheBerlios%2Flucane-svn')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FBackupTheBerlios%2Flucane-svn%2Fblob%2Fmaster%2Ftrunk%2Fserver%2Fsrc%2Forg%2Flucane%2Fserver%2Fstore%2FLdapConfig.java">LdapConfig.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FBackupTheBerlios%2Flucane-svn">BackupTheBerlios/lucane-svn</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="2"> <pre class="line-numbers language-java" data-end="83" data-start="54" data-highlight="67,75,76,78,80"> /** * Constructor * * @param filename the XML config file */ public LdapConfig(String filename) throws Exception { DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document document = builder.parse(filename); // -- root element Node node = document.getFirstChild(); while (node != null && node.getNodeType() != Node.ELEMENT_NODE) node = node.getNextSibling(); if (node == null || !node.getNodeName().equals("ldap")) throw new Exception("root element is different from 'ldap'"); this.ldapUrl = node.getAttributes().getNamedItem("url").getNodeValue(); node = node.getFirstChild(); while (node != null) { if (node.getNodeType() == Node.ELEMENT_NODE) { if (node.getNodeName().equals("authentication")) handleAuthentication(node); else if (node.getNodeName().equals("plugins")) handlePlugins(node); else if (node.getNodeName().equals("services")) handleServices(node); else if (node.getNodeName().equals("users")) handleUsers(node); else if (node.getNodeName().equals("groups")) handleGroups(node); else Logging.getLogger().warning("unexepected node : " + node.getNodeName()); } node = node.getNextSibling(); } }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-108"> <div style="text-align: center;"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- after-example-2 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="7155150962" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="example-item" id="0xa1077059d1a26f76e856650eb588b2da5ad5c5ffedd29e5cc9c2bf2e2559e368-835,,861,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #3</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_3" data-hash="0xa1077059d1a26f76e856650eb588b2da5ad5c5ffedd29e5cc9c2bf2e2559e368" data-area="835,,861,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '3')" class="rating-up btn btn-success" data-id="rating_3"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'3')" class="rating-down btn btn-danger" data-id="rating_3"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xa1077059d1a26f76e856650eb588b2da5ad5c5ffedd29e5cc9c2bf2e2559e368-835,,861,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xa1077059d1a26f76e856650eb588b2da5ad5c5ffedd29e5cc9c2bf2e2559e368&fullName=src%2Forg%2Fbroad%2Figv%2FIGVSessionReader.java&project=dhmay%2FIGV')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fdhmay%2FIGV%2Fblob%2Fmaster%2Fsrc%2Forg%2Fbroad%2Figv%2FIGVSessionReader.java">IGVSessionReader.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fdhmay%2FIGV">dhmay/IGV</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="3"> <pre class="line-numbers language-java" data-end="861" data-start="836" data-highlight="847,849"> private void processPanel(Session session, Element element, HashMap additionalInformation) { panelElementPresent = true; String panelName = element.getAttribute("name"); if (panelName == null) { panelName = "Panel" + panelCounter++; } List<Track> panelTracks = new ArrayList(); NodeList elements = element.getChildNodes(); for (int i = 0; i < elements.getLength(); i++) { Node childNode = elements.item(i); if (childNode.getNodeName().equalsIgnoreCase(SessionElement.DATA_TRACK.getText()) || // Is this a track? childNode.getNodeName().equalsIgnoreCase(SessionElement.TRACK.getText())) { List<Track> tracks = processTrack(session, (Element) childNode, additionalInformation); if (tracks != null) { panelTracks.addAll(tracks); } } else { process(session, childNode, additionalInformation); } } TrackPanel panel = IGV.getInstance().getTrackPanel(panelName); panel.addTracks(panelTracks); }</pre> </div> </figure> </div> <div id="ezoic-pub-ad-placeholder-109"> <div style="text-align: center;"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- after-example-3 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="8699811701" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="example-item" id="0xa6372e374ab70c480890c37ad029639606e92e55c38ddcf06cd2913fc43d3060-385,,443,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #4</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_4" data-hash="0xa6372e374ab70c480890c37ad029639606e92e55c38ddcf06cd2913fc43d3060" data-area="385,,443,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '4')" class="rating-up btn btn-success" data-id="rating_4"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'4')" class="rating-down btn btn-danger" data-id="rating_4"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xa6372e374ab70c480890c37ad029639606e92e55c38ddcf06cd2913fc43d3060-385,,443,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xa6372e374ab70c480890c37ad029639606e92e55c38ddcf06cd2913fc43d3060&fullName=src%2Fcn%2Fedu%2Fthss%2Fiise%2Fbeehivez%2Fserver%2FAMLtoPNML.java&project=CaoAo%2FBeehiveZ')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FCaoAo%2FBeehiveZ%2Fblob%2Fmaster%2Fsrc%2Fcn%2Fedu%2Fthss%2Fiise%2Fbeehivez%2Fserver%2FAMLtoPNML.java">AMLtoPNML.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FCaoAo%2FBeehiveZ">CaoAo/BeehiveZ</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="4"> <pre class="line-numbers language-java" data-end="443" data-start="386" data-highlight="391,394,403,409"> public static void traverseAMLforObjectNames( HashMap partialMap, Node currentNode, HashMap ObjDef_LinkId, HashMap ModelId_ModelType) { if (currentNode.hasChildNodes()) { for (int i = 0; i < currentNode.getChildNodes().getLength(); i++) { Node currentChild = currentNode.getChildNodes().item(i); if (currentChild.getNodeName().equals("Group")) { traverseAMLforObjectNames(partialMap, currentChild, ObjDef_LinkId, ModelId_ModelType); } if (currentChild.getNodeName().equals("Model")) { if (currentChild.hasAttributes()) { String mid = currentChild.getAttributes().getNamedItem("Model.ID").getNodeValue(); String type = currentChild.getAttributes().getNamedItem("Model.Type").getNodeValue(); ModelId_ModelType.put(mid, type); } // traverseAMLforObjectNames(partialMap, currentChild, // ObjDef_LinkId); } if (currentChild.getNodeName().equals("ObjDef")) { String id = currentChild.getAttributes().getNamedItem("ObjDef.ID").getNodeValue(); NodeList currentChildren = currentChild.getChildNodes(); String ObjName = ""; for (int k = 0; k < currentChildren.getLength(); k++) { Node Child = currentChildren.item(k); if (!Child.getNodeName().equals("AttrDef")) { continue; } else if (!Child.getAttributes() .getNamedItem("AttrDef.Type") .getNodeValue() .equals("AT_NAME")) { continue; } else if (Child.hasChildNodes()) { for (int l = 0; l < Child.getChildNodes().getLength(); l++) { if (!(Child.getChildNodes().item(l).getNodeName().equals("AttrValue"))) { continue; } else { ObjName = getTextContent(Child.getChildNodes().item(l)); ObjName = ObjName.replaceAll("\n", "\\\\n"); break; } } } } partialMap.put(id, ObjName); for (int j = 0; j < currentChild.getAttributes().getLength(); j++) { if (currentChild.getAttributes().item(j).getNodeName().equals("LinkedModels.IdRefs")) { String links = currentChild.getAttributes().getNamedItem("LinkedModels.IdRefs").getNodeValue(); /* * if (links.indexOf(" ") > -1) { * Message.add("yes, yes, yes"); links = * links.substring(0, links.indexOf(" ")); } */ ObjDef_LinkId.put(id, links); } } } } } }</pre> </div> </figure> </div> <div class="example-item" id="0xcb3e597dc701308e8f25944ab3bdf8f950b2c9399538a19ec5a509ca2b20d126-138,,194,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #5</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_5" data-hash="0xcb3e597dc701308e8f25944ab3bdf8f950b2c9399538a19ec5a509ca2b20d126" data-area="138,,194,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '5')" class="rating-up btn btn-success" data-id="rating_5"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'5')" class="rating-down btn btn-danger" data-id="rating_5"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xcb3e597dc701308e8f25944ab3bdf8f950b2c9399538a19ec5a509ca2b20d126-138,,194,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xcb3e597dc701308e8f25944ab3bdf8f950b2c9399538a19ec5a509ca2b20d126&fullName=languages%2FNatlab%2Fsrc%2Fnatlab%2Ftame%2Fmc4%2FResultValue.java&project=sujaykathrotia%2Fmclab')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fsujaykathrotia%2Fmclab%2Fblob%2Fmaster%2Flanguages%2FNatlab%2Fsrc%2Fnatlab%2Ftame%2Fmc4%2FResultValue.java">ResultValue.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fsujaykathrotia%2Fmclab">sujaykathrotia/mclab</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="5"> <pre class="line-numbers language-java" data-end="194" data-start="139" data-highlight="143,146,154,158,163,167,171,174,191,186"> public ResultValue(Node node) { NodeList list = node.getChildNodes(); for (int i = 0; i < list.getLength(); i++) { Node n = list.item(i); if (n.getNodeName().equals("class")) { matlabClass = n.getTextContent(); } if (n.getNodeName().equals("size")) { size = string2intList(n.getTextContent()); numdims = size.size(); numel = 1; for (int d : size) { numel *= d; } } if (n.getNodeName().equals("matrix")) { resultType = RESULT_TYPE.MATRIX; matrixResult = string2doubleList(n.getTextContent()); } if (n.getNodeName().equals("imagMatrix")) { isReal = false; resultType = RESULT_TYPE.MATRIX; imagMatrixResult = string2doubleList(n.getTextContent()); } if (n.getNodeName().equals("char")) { resultType = RESULT_TYPE.CHAR; charResult = n.getTextContent(); } if (n.getNodeName().equals("logical")) { resultType = RESULT_TYPE.LOGICAL; logicalResult = string2booleanList(n.getTextContent()); } if (n.getNodeName().equals("handle")) { resultType = RESULT_TYPE.HANDLE; } if (n.getNodeName().equals("struct")) { resultType = RESULT_TYPE.STRUCT; // create struct list for first occurence of struct if (structResult == null) { structResult = new ArrayList<HashMap<String, ResultValue>>(); } // build struct HashMap<String, ResultValue> struct = new HashMap<String, ResultValue>(); NodeList children = n.getChildNodes(); for (int j = 0; j < children.getLength(); j++) { Node child = children.item(j); if (child.getNodeType() == Node.ELEMENT_NODE) { struct.put(child.getNodeName(), new ResultValue(child)); } } structResult.add(struct); } if (n.getNodeName().equals("cell")) { resultType = RESULT_TYPE.CELL; } } }</pre> </div> </figure> </div> <div class="example-item" id="0x43eb96ea645d57def2b22035cce1adb82209b0fb46a7c9fdf482ac1eaeb883f8-141,,195,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #6</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_6" data-hash="0x43eb96ea645d57def2b22035cce1adb82209b0fb46a7c9fdf482ac1eaeb883f8" data-area="141,,195,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '6')" class="rating-up btn btn-success" data-id="rating_6"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'6')" class="rating-down btn btn-danger" data-id="rating_6"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x43eb96ea645d57def2b22035cce1adb82209b0fb46a7c9fdf482ac1eaeb883f8-141,,195,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x43eb96ea645d57def2b22035cce1adb82209b0fb46a7c9fdf482ac1eaeb883f8&fullName=src%2Fjavaanpr%2FNeuralNetwork.java&project=eried%2Fjavaanpr')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Feried%2Fjavaanpr%2Fblob%2Fmaster%2Fsrc%2Fjavaanpr%2FNeuralNetwork.java">NeuralNetwork.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Feried%2Fjavaanpr">eried/javaanpr</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="6"> <pre class="line-numbers language-java" data-end="195" data-start="142" data-highlight="150,159,163,169,180"> private void loadFromXml(String fileName) throws ParserConfigurationException, SAXException, IOException, ParseException { System.out.println("NeuralNetwork : loading network topology from file " + fileName); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder parser = factory.newDocumentBuilder(); Document doc = parser.parse(fileName); Node nodeNeuralNetwork = doc.getDocumentElement(); if (!nodeNeuralNetwork.getNodeName().equals("neuralNetwork")) throw new ParseException( "[Error] NN-Load: Parse error in XML file, neural network couldn't be loaded.", 0); // nodeNeuralNetwork ok // indexNeuralNetworkContent -> indexStructureContent -> indexLayerContent -> indexNeuronContent // -> indexNeuralInputContent NodeList nodeNeuralNetworkContent = nodeNeuralNetwork.getChildNodes(); for (int innc = 0; innc < nodeNeuralNetworkContent.getLength(); innc++) { Node nodeStructure = nodeNeuralNetworkContent.item(innc); if (nodeStructure.getNodeName().equals("structure")) { // for structure element NodeList nodeStructureContent = nodeStructure.getChildNodes(); for (int isc = 0; isc < nodeStructureContent.getLength(); isc++) { Node nodeLayer = nodeStructureContent.item(isc); if (nodeLayer.getNodeName().equals("layer")) { // for layer element NeuralLayer neuralLayer = new NeuralLayer(this); this.listLayers.add(neuralLayer); NodeList nodeLayerContent = nodeLayer.getChildNodes(); for (int ilc = 0; ilc < nodeLayerContent.getLength(); ilc++) { Node nodeNeuron = nodeLayerContent.item(ilc); if (nodeNeuron.getNodeName().equals("neuron")) { // for neuron in layer Neuron neuron = new Neuron( Double.parseDouble(((Element) nodeNeuron).getAttribute("threshold")), neuralLayer); neuralLayer.listNeurons.add(neuron); NodeList nodeNeuronContent = nodeNeuron.getChildNodes(); for (int inc = 0; inc < nodeNeuronContent.getLength(); inc++) { Node nodeNeuralInput = nodeNeuronContent.item(inc); // if (nodeNeuralInput==null) System.out.print("-"); else System.out.print("*"); if (nodeNeuralInput.getNodeName().equals("input")) { // System.out.println("neuron at // STR:"+innc+" LAY:"+isc+" NEU:"+ilc+" INP:"+inc); NeuralInput neuralInput = new NeuralInput( Double.parseDouble(((Element) nodeNeuralInput).getAttribute("weight")), neuron); neuron.listInputs.add(neuralInput); } } } } } } } } }</pre> </div> </figure> </div> <div class="example-item" id="0x72e3f7fbb50d0f3e27239ee12ec646cc2b8438fecb2c573b16225351ab0ba4db-153,,170,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #7</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_7" data-hash="0x72e3f7fbb50d0f3e27239ee12ec646cc2b8438fecb2c573b16225351ab0ba4db" data-area="153,,170,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '7')" class="rating-up btn btn-success" data-id="rating_7"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'7')" class="rating-down btn btn-danger" data-id="rating_7"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x72e3f7fbb50d0f3e27239ee12ec646cc2b8438fecb2c573b16225351ab0ba4db-153,,170,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x72e3f7fbb50d0f3e27239ee12ec646cc2b8438fecb2c573b16225351ab0ba4db&fullName=trunk%2Fserver%2Fsrc%2Forg%2Flucane%2Fserver%2Fstore%2FLdapConfig.java&project=BackupTheBerlios%2Flucane-svn')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FBackupTheBerlios%2Flucane-svn%2Fblob%2Fmaster%2Ftrunk%2Fserver%2Fsrc%2Forg%2Flucane%2Fserver%2Fstore%2FLdapConfig.java">LdapConfig.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FBackupTheBerlios%2Flucane-svn">BackupTheBerlios/lucane-svn</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="7"> <pre class="line-numbers language-java" data-end="170" data-start="154" data-highlight="165,166,167"> /** * Parse groups node * * @param node the groups node */ private void handleGroups(Node node) { this.groupsDn = node.getAttributes().getNamedItem("dn").getNodeValue(); node = node.getFirstChild(); while (node != null) { if (node.getNodeType() == Node.ELEMENT_NODE) { if (node.getNodeName().equals("attribute")) handleMapping(this.groupsAttributes, node); else if (node.getNodeName().equals("mapping")) handleMapping(this.groupsMapping, node); else Logging.getLogger().warning("unexepected node : " + node.getNodeName()); } node = node.getNextSibling(); } }</pre> </div> </figure> </div> <div class="example-item" id="0xba61ca3614d49f3286c8212ffaac59d023b628f391605bb8f331900cfe53eeb9-787,,804,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #8</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_8" data-hash="0xba61ca3614d49f3286c8212ffaac59d023b628f391605bb8f331900cfe53eeb9" data-area="787,,804,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '8')" class="rating-up btn btn-success" data-id="rating_8"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'8')" class="rating-down btn btn-danger" data-id="rating_8"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xba61ca3614d49f3286c8212ffaac59d023b628f391605bb8f331900cfe53eeb9-787,,804,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xba61ca3614d49f3286c8212ffaac59d023b628f391605bb8f331900cfe53eeb9&fullName=src%2Fedu%2Fwpi%2Fcs%2Fjburge%2FSEURAT%2FPatternDecision.java&project=burgeje%2FSEURAT')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fburgeje%2FSEURAT%2Fblob%2Fmaster%2Fsrc%2Fedu%2Fwpi%2Fcs%2Fjburge%2FSEURAT%2FPatternDecision.java">PatternDecision.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fburgeje%2FSEURAT">burgeje/SEURAT</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="8"> <pre class="line-numbers language-java" data-end="804" data-start="788" data-highlight="797,800"> /** * This is just a helper function for the fromXML method. * * @param child */ public void importHelper(Node child) { if (child.getFirstChild() instanceof Text) { Text text = (Text) child.getFirstChild(); String data = text.getData(); if (child.getNodeName().equals("description")) { setDescription(data); } if (child.getNodeName().equals("refChildPattern")) { int decID = Integer.parseInt(data.substring(1)); subPatternsID.add(decID); } } }</pre> </div> </figure> </div> <div class="example-item" id="0x5b7304f329d4b48334bd0803b48914b7a7707ffca2667b612e53f654d5be3e40-102,,162,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #9</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_9" data-hash="0x5b7304f329d4b48334bd0803b48914b7a7707ffca2667b612e53f654d5be3e40" data-area="102,,162,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '9')" class="rating-up btn btn-success" data-id="rating_9"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'9')" class="rating-down btn btn-danger" data-id="rating_9"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x5b7304f329d4b48334bd0803b48914b7a7707ffca2667b612e53f654d5be3e40-102,,162,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x5b7304f329d4b48334bd0803b48914b7a7707ffca2667b612e53f654d5be3e40&fullName=LDP%2Fscrollserver%2Fstylesheets%2Fdocbook%2Fextensions%2Fsaxon643%2Fcom%2Fnwalsh%2FCalloutEmitter.java&project=charan5076%2FLDP')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fcharan5076%2FLDP%2Fblob%2Fmaster%2FLDP%2Fscrollserver%2Fstylesheets%2Fdocbook%2Fextensions%2Fsaxon643%2Fcom%2Fnwalsh%2FCalloutEmitter.java">CalloutEmitter.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fcharan5076%2FLDP">charan5076/LDP</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="9"> <pre class="line-numbers language-java" data-end="162" data-start="103" data-highlight="139,152,156,145,148"> /** * Examine the areaspec and determine the number and position of callouts. * * <p>The <code><a href="http://docbook.org/tdg/html/areaspec.html">areaspecNodeSet</a></code> is * examined and a sorted list of the callouts is constructed. * * <p>This data structure is used to augment the result tree fragment with callout bullets. * * @param areaspecNodeSet The source document &lt;areaspec&gt; element. */ public void setupCallouts(NodeList areaspecNodeList) { callout = new Callout[10]; calloutCount = 0; calloutPos = 0; lineNumber = 1; colNumber = 1; // First we walk through the areaspec to calculate the position // of the callouts // <areaspec> // <areaset id="ex.plco.const" coords=""> // <area id="ex.plco.c1" coords="4"/> // <area id="ex.plco.c2" coords="8"/> // </areaset> // <area id="ex.plco.ret" coords="12"/> // <area id="ex.plco.dest" coords="12"/> // </areaspec> int pos = 0; int coNum = 0; boolean inAreaSet = false; Node areaspec = areaspecNodeList.item(0); NodeList children = areaspec.getChildNodes(); for (int count = 0; count < children.getLength(); count++) { Node node = children.item(count); if (node.getNodeType() == Node.ELEMENT_NODE) { if (node.getNodeName().equalsIgnoreCase("areaset")) { coNum++; NodeList areas = node.getChildNodes(); for (int acount = 0; acount < areas.getLength(); acount++) { Node area = areas.item(acount); if (area.getNodeType() == Node.ELEMENT_NODE) { if (area.getNodeName().equalsIgnoreCase("area")) { addCallout(coNum, area, defaultColumn); } else { System.out.println("Unexpected element in areaset: " + area.getNodeName()); } } } } else if (node.getNodeName().equalsIgnoreCase("area")) { coNum++; addCallout(coNum, node, defaultColumn); } else { System.out.println("Unexpected element in areaspec: " + node.getNodeName()); } } } // Now sort them java.util.Arrays.sort(callout, 0, calloutCount); }</pre> </div> </figure> </div> <div class="example-item" id="0xd23a0d4844a29f271e5a2e0549031d30e60321f7d0fa34e69b656840f0fec16b-100,,114,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #10</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_10" data-hash="0xd23a0d4844a29f271e5a2e0549031d30e60321f7d0fa34e69b656840f0fec16b" data-area="100,,114,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '10')" class="rating-up btn btn-success" data-id="rating_10"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'10')" class="rating-down btn btn-danger" data-id="rating_10"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xd23a0d4844a29f271e5a2e0549031d30e60321f7d0fa34e69b656840f0fec16b-100,,114,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xd23a0d4844a29f271e5a2e0549031d30e60321f7d0fa34e69b656840f0fec16b&fullName=bdaf%2FFinal+Draft+Stuff%2FSimulation.java&project=claydumbgameaim%2FGit-Test')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fclaydumbgameaim%2FGit-Test%2Fblob%2Fmaster%2Fbdaf%2FFinal+Draft+Stuff%2FSimulation.java">Simulation.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fclaydumbgameaim%2FGit-Test">claydumbgameaim/Git-Test</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="10"> <pre class="line-numbers language-java" data-end="114" data-start="101" data-highlight="105,105"> /** Helper method to perform CTS, RTS handshake. */ private void performHandshake(Node sender, Node receiver) { ArrayList<Node> NodesInRange = receiver.getNodesInRange(); for (Node i : NodesInRange) { // For each node in receiver side if not the sender node if (!i.getNodeName().equals(sender.getNodeName())) { i.setWaiting(true); } } sender.setIdle(false); receiver.setIdle(false); sender.setSentRTS(true); receiver.setSentCTS(true); sender.setReceivedCTS(true); }</pre> </div> </figure> </div> <div class="example-item" id="0x5bb5715c3623a428cf938e4d3192c0a65cc799d49f3b0c789e10f514bd6675ed-36,,50,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #11</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_11" data-hash="0x5bb5715c3623a428cf938e4d3192c0a65cc799d49f3b0c789e10f514bd6675ed" data-area="36,,50,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '11')" class="rating-up btn btn-success" data-id="rating_11"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'11')" class="rating-down btn btn-danger" data-id="rating_11"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x5bb5715c3623a428cf938e4d3192c0a65cc799d49f3b0c789e10f514bd6675ed-36,,50,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x5bb5715c3623a428cf938e4d3192c0a65cc799d49f3b0c789e10f514bd6675ed&fullName=applications%2Fpetascope%2Fsrc%2Fmain%2Fjava%2Fpetascope%2Fwcps%2Fserver%2FAxisName.java&project=dioptre%2Frasdaman')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fdioptre%2Frasdaman%2Fblob%2Fmaster%2Fapplications%2Fpetascope%2Fsrc%2Fmain%2Fjava%2Fpetascope%2Fwcps%2Fserver%2FAxisName.java">AxisName.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fdioptre%2Frasdaman">dioptre/rasdaman</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="11"> <pre class="line-numbers language-java" data-end="50" data-start="37" data-highlight="38,42,43"> public AxisName(Node node, XmlQuery xq) throws WCPSException { while ((node != null) && node.getNodeName().equals("#" + WCPSConstants.MSG_TEXT)) { node = node.getNextSibling(); } if (node != null && node.getNodeName().equals(WCPSConstants.MSG_AXIS)) { log.trace(node.getNodeName()); String axis = node.getTextContent(); this.name = axis; log.trace(" " + WCPSConstants.MSG_AXIS + " " + WCPSConstants.MSG_NAME + ": " + name); } else { throw new WCPSException( ExceptionCode.InvalidRequest, WCPSConstants.ERRTXT_COULD_NOT_FIND_AXIS + " !"); } }</pre> </div> </figure> </div> <div class="example-item" id="0x54607367abb2b8af0d04c6498aca6c1fa8cc60e37f0df94fae487b55f38c9ffe-36,,83,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #12</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_12" data-hash="0x54607367abb2b8af0d04c6498aca6c1fa8cc60e37f0df94fae487b55f38c9ffe" data-area="36,,83,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '12')" class="rating-up btn btn-success" data-id="rating_12"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'12')" class="rating-down btn btn-danger" data-id="rating_12"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x54607367abb2b8af0d04c6498aca6c1fa8cc60e37f0df94fae487b55f38c9ffe-36,,83,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x54607367abb2b8af0d04c6498aca6c1fa8cc60e37f0df94fae487b55f38c9ffe&fullName=src%2Fnet%2Fjava%2Fsip%2Fcommunicator%2Fplugin%2FParameters.java&project=nagyist%2Fjitsi')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fnagyist%2Fjitsi%2Fblob%2Fmaster%2Fsrc%2Fnet%2Fjava%2Fsip%2Fcommunicator%2Fplugin%2FParameters.java">Parameters.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fnagyist%2Fjitsi">nagyist/jitsi</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="12"> <pre class="line-numbers language-java" data-end="83" data-start="37" data-highlight="69,71,74"> static { try { URL url = SpellCheckActivator.bundleContext.getBundle().getResource(RESOURCE_LOC); InputStream stream = url.openStream(); if (stream == null) throw new IOException(); // strict parsing options DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(false); factory.setIgnoringComments(true); factory.setIgnoringElementContentWhitespace(true); // parses configuration xml /*- * Warning: Felix is unable to import the com.sun.rowset.internal * package, meaning this can't use the XmlErrorHandler. This causes * a warning and a default handler to be attached. Otherwise this * should have: builder.setErrorHandler(new XmlErrorHandler()); */ DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse(stream); // iterates over nodes, parsing contents Node root = doc.getChildNodes().item(1); NodeList categories = root.getChildNodes(); for (int i = 0; i < categories.getLength(); ++i) { Node node = categories.item(i); if (node.getNodeName().equals(NODE_DEFAULTS)) { parseDefaults(node.getChildNodes()); } else if (node.getNodeName().equals(NODE_LOCALES)) { parseLocales(node.getChildNodes()); } else { logger.warn("Unrecognized category: " + node.getNodeName()); } } } catch (IOException exc) { logger.error("Unable to load spell checker parameters", exc); } catch (SAXException exc) { logger.error("Unable to parse spell checker parameters", exc); } catch (ParserConfigurationException exc) { logger.error("Unable to parse spell checker parameters", exc); } }</pre> </div> </figure> </div> <div class="example-item" id="0x7af7faa1363954a898fe32e5dfcde73a605fac9a03cb4d0c7cc0607d38ecb1b9-48,,76,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #13</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_13" data-hash="0x7af7faa1363954a898fe32e5dfcde73a605fac9a03cb4d0c7cc0607d38ecb1b9" data-area="48,,76,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '13')" class="rating-up btn btn-success" data-id="rating_13"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'13')" class="rating-down btn btn-danger" data-id="rating_13"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x7af7faa1363954a898fe32e5dfcde73a605fac9a03cb4d0c7cc0607d38ecb1b9-48,,76,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x7af7faa1363954a898fe32e5dfcde73a605fac9a03cb4d0c7cc0607d38ecb1b9&fullName=tools%2Fclasses%2Fcom%2Foddlabs%2FAnimationLoader.java&project=grafov%2Ftribaltrouble')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fgrafov%2Ftribaltrouble%2Fblob%2Fmaster%2Ftools%2Fclasses%2Fcom%2Foddlabs%2FAnimationLoader.java">AnimationLoader.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fgrafov%2Ftribaltrouble">grafov/tribaltrouble</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="13"> <pre class="line-numbers language-java" data-end="76" data-start="49" data-highlight="54"> public static final Map parseFrame(Node node) { NodeList bones = node.getChildNodes(); Map bone_infos = new HashMap(); for (int i = 0; i < bones.getLength(); i++) { Node bone = bones.item(i); if (bone.getNodeName().equals("transform")) { String name = bone.getAttributes().getNamedItem("name").getNodeValue(); float[] matrix = new float[16]; matrix[0 * 4 + 0] = getAttrFloat(bone, "m00"); matrix[0 * 4 + 1] = getAttrFloat(bone, "m01"); matrix[0 * 4 + 2] = getAttrFloat(bone, "m02"); matrix[0 * 4 + 3] = getAttrFloat(bone, "m03"); matrix[1 * 4 + 0] = getAttrFloat(bone, "m10"); matrix[1 * 4 + 1] = getAttrFloat(bone, "m11"); matrix[1 * 4 + 2] = getAttrFloat(bone, "m12"); matrix[1 * 4 + 3] = getAttrFloat(bone, "m13"); matrix[2 * 4 + 0] = getAttrFloat(bone, "m20"); matrix[2 * 4 + 1] = getAttrFloat(bone, "m21"); matrix[2 * 4 + 2] = getAttrFloat(bone, "m22"); matrix[2 * 4 + 3] = getAttrFloat(bone, "m23"); matrix[3 * 4 + 0] = getAttrFloat(bone, "m30"); matrix[3 * 4 + 1] = getAttrFloat(bone, "m31"); matrix[3 * 4 + 2] = getAttrFloat(bone, "m32"); matrix[3 * 4 + 3] = getAttrFloat(bone, "m33"); bone_infos.put(name, matrix); } } return bone_infos; }</pre> </div> </figure> </div> <div class="example-item" id="0x26b55ee5849a93ea8883fd2eda5a30cdb468c8d82fbdbf5a74ed67942e650881-94,,123,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #14</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_14" data-hash="0x26b55ee5849a93ea8883fd2eda5a30cdb468c8d82fbdbf5a74ed67942e650881" data-area="94,,123,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '14')" class="rating-up btn btn-success" data-id="rating_14"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'14')" class="rating-down btn btn-danger" data-id="rating_14"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x26b55ee5849a93ea8883fd2eda5a30cdb468c8d82fbdbf5a74ed67942e650881-94,,123,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x26b55ee5849a93ea8883fd2eda5a30cdb468c8d82fbdbf5a74ed67942e650881&fullName=DivisionOperatorWorkspaceObject.java&project=Davidlx%2FSAD_CW')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FDavidlx%2FSAD_CW%2Fblob%2Fmaster%2FDivisionOperatorWorkspaceObject.java">DivisionOperatorWorkspaceObject.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FDavidlx%2FSAD_CW">Davidlx/SAD_CW</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="14"> <pre class="line-numbers language-java" data-end="123" data-start="95" data-highlight="96"> static DivisionOperatorWorkspaceObject load(Node node) throws ProgramLoadingException { if (!node.getNodeName().equals("division")) throw new ProgramLoadingException(); DivisionOperatorWorkspaceObject obj = new DivisionOperatorWorkspaceObject(Workspace.getWorkspace()); Node lop = Workspace.getChildElementByName(node, "loperand"); Node rop = Workspace.getChildElementByName(node, "roperand"); if (lop != null) { Node lopNode = Workspace.getNthChildElement(lop, 0); if (lopNode != null) { WorkspaceObject lopObj = Workspace.dispatchLoad(lopNode); if (lopObj != null) { obj.leftSink.progCombine(lopObj); } } } if (rop != null) { Node ropNode = Workspace.getNthChildElement(rop, 0); if (ropNode != null) { WorkspaceObject ropObj = Workspace.dispatchLoad(ropNode); if (ropObj != null) { obj.rightSink.progCombine(ropObj); } } } return obj; }</pre> </div> </figure> </div> <div class="example-item" id="0x491846d2597f7928669e0e293dac93f350b6fe8b5846a919d3992ade11406f8a-250,,282,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #15</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_15" data-hash="0x491846d2597f7928669e0e293dac93f350b6fe8b5846a919d3992ade11406f8a" data-area="250,,282,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '15')" class="rating-up btn btn-success" data-id="rating_15"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'15')" class="rating-down btn btn-danger" data-id="rating_15"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x491846d2597f7928669e0e293dac93f350b6fe8b5846a919d3992ade11406f8a-250,,282,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x491846d2597f7928669e0e293dac93f350b6fe8b5846a919d3992ade11406f8a&fullName=agent%2Fcore%2Fsrc%2Fmain%2Fjava%2Forg%2Fjolokia%2FPolicyBasedRestrictor.java&project=ludovicc%2Fjolokia')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fludovicc%2Fjolokia%2Fblob%2Fmaster%2Fagent%2Fcore%2Fsrc%2Fmain%2Fjava%2Forg%2Fjolokia%2FPolicyBasedRestrictor.java">PolicyBasedRestrictor.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fludovicc%2Fjolokia">ludovicc/jolokia</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="15"> <pre class="line-numbers language-java" data-end="282" data-start="251" data-highlight="264"> private void extractMBeanPolicy(MBeanPolicyConfig pConfig, Node pMBeanNode) throws MalformedObjectNameException { NodeList params = pMBeanNode.getChildNodes(); String name = null; Set<String> readAttributes = new HashSet<String>(); Set<String> writeAttributes = new HashSet<String>(); Set<String> operations = new HashSet<String>(); for (int k = 0; k < params.getLength(); k++) { Node param = params.item(k); if (param.getNodeType() != Node.ELEMENT_NODE) { continue; } assertNodeName(param, "name", "attribute", "operation"); String tag = param.getNodeName(); if (tag.equals("name")) { if (name != null) { throw new SecurityException("<name> given twice as MBean name"); } else { name = param.getTextContent().trim(); } } else if (tag.equals("attribute")) { extractAttribute(readAttributes, writeAttributes, param); } else if (tag.equals("operation")) { operations.add(param.getTextContent().trim()); } else { throw new SecurityException("Tag <" + tag + "> invalid"); } } if (name == null) { throw new SecurityException("No <name> given for <mbean>"); } pConfig.addValues(new ObjectName(name), readAttributes, writeAttributes, operations); }</pre> </div> </figure> </div> <div class="example-item" id="0x491846d2597f7928669e0e293dac93f350b6fe8b5846a919d3992ade11406f8a-324,,339,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #16</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_16" data-hash="0x491846d2597f7928669e0e293dac93f350b6fe8b5846a919d3992ade11406f8a" data-area="324,,339,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '16')" class="rating-up btn btn-success" data-id="rating_16"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'16')" class="rating-down btn btn-danger" data-id="rating_16"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x491846d2597f7928669e0e293dac93f350b6fe8b5846a919d3992ade11406f8a-324,,339,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x491846d2597f7928669e0e293dac93f350b6fe8b5846a919d3992ade11406f8a&fullName=agent%2Fcore%2Fsrc%2Fmain%2Fjava%2Forg%2Fjolokia%2FPolicyBasedRestrictor.java&project=ludovicc%2Fjolokia')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fludovicc%2Fjolokia%2Fblob%2Fmaster%2Fagent%2Fcore%2Fsrc%2Fmain%2Fjava%2Forg%2Fjolokia%2FPolicyBasedRestrictor.java">PolicyBasedRestrictor.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fludovicc%2Fjolokia">ludovicc/jolokia</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="16"> <pre class="line-numbers language-java" data-end="339" data-start="325" data-highlight="327,339"> private void assertNodeName(Node pNode, String... pExpected) { for (String expected : pExpected) { if (pNode.getNodeName().equals(expected)) { return; } } StringBuffer buffer = new StringBuffer(); for (int i = 0; i < pExpected.length; i++) { buffer.append(pExpected[i]); if (i < pExpected.length - 1) { buffer.append(","); } } throw new SecurityException( "Expected element " + buffer.toString() + " but got " + pNode.getNodeName()); }</pre> </div> </figure> </div> <div class="example-item" id="0xba04e711c1d5a45d9e66ec041065a1c5bc939a19255370a1966f2e0be4a9ea92-157,,184,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #17</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_17" data-hash="0xba04e711c1d5a45d9e66ec041065a1c5bc939a19255370a1966f2e0be4a9ea92" data-area="157,,184,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '17')" class="rating-up btn btn-success" data-id="rating_17"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'17')" class="rating-down btn btn-danger" data-id="rating_17"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xba04e711c1d5a45d9e66ec041065a1c5bc939a19255370a1966f2e0be4a9ea92-157,,184,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xba04e711c1d5a45d9e66ec041065a1c5bc939a19255370a1966f2e0be4a9ea92&fullName=CommandBuilder.java&project=Desttro%2FDungeonBuilder')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FDesttro%2FDungeonBuilder%2Fblob%2Fmaster%2FCommandBuilder.java">CommandBuilder.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FDesttro%2FDungeonBuilder">Desttro/DungeonBuilder</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="17"> <pre class="line-numbers language-java" data-end="184" data-start="158" data-highlight="170"> private static Command parseCommand(Node n) { NamedNodeMap atts = n.getAttributes(); String name = atts.getNamedItem("name").getNodeValue(); String desc = atts.getNamedItem("description").getNodeValue(); String command = atts.getNamedItem("command").getNodeValue(); Command com = new Command(name, desc, command); NodeList children = n.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); if (!child.getNodeName().equals("Argument")) continue; NamedNodeMap childAtts = child.getAttributes(); String childName = childAtts.getNamedItem("name").getNodeValue(); String childDesc = childAtts.getNamedItem("description").getNodeValue(); String childVal = ""; if (childAtts.getNamedItem("default") != null) childVal = childAtts.getNamedItem("default").getNodeValue(); Argument arg = new Argument(childName, childDesc, childVal); com.addArgument(arg); } return com; }</pre> </div> </figure> </div> <div class="example-item" id="0xa68de41a58a1be4459aa83d3881b425cec0eec64dc6f81b45de074a5bfb30e0b-121,,146,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #18</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_18" data-hash="0xa68de41a58a1be4459aa83d3881b425cec0eec64dc6f81b45de074a5bfb30e0b" data-area="121,,146,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '18')" class="rating-up btn btn-success" data-id="rating_18"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'18')" class="rating-down btn btn-danger" data-id="rating_18"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xa68de41a58a1be4459aa83d3881b425cec0eec64dc6f81b45de074a5bfb30e0b-121,,146,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xa68de41a58a1be4459aa83d3881b425cec0eec64dc6f81b45de074a5bfb30e0b&fullName=core%2Fsrc%2Fmain%2Fjava%2Fhudson%2FAbstractCIBase.java&project=kutzi%2Fjenkins')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkutzi%2Fjenkins%2Fblob%2Fmaster%2Fcore%2Fsrc%2Fmain%2Fjava%2Fhudson%2FAbstractCIBase.java">AbstractCIBase.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fkutzi%2Fjenkins">kutzi/jenkins</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="18"> <pre class="line-numbers language-java" data-end="146" data-start="122" data-highlight="126"> private void updateComputer( Node n, Map<String, Computer> byNameMap, Set<Computer> used, boolean automaticSlaveLaunch) { Map<Node, Computer> computers = getComputerMap(); Computer c; c = byNameMap.get(n.getNodeName()); if (c != null) { c.setNode(n); // reuse } else { // we always need Computer for the master as a fallback in case there's no other Computer. if (n.getNumExecutors() > 0 || n == Jenkins.getInstance()) { computers.put(n, c = n.createComputer()); if (!n.isHoldOffLaunchUntilSave() && automaticSlaveLaunch) { RetentionStrategy retentionStrategy = c.getRetentionStrategy(); if (retentionStrategy != null) { // if there is a retention strategy, it is responsible for deciding to start the // computer retentionStrategy.start(c); } else { // we should never get here, but just in case, we'll fall back to the legacy behaviour c.connect(true); } } } } used.add(c); }</pre> </div> </figure> </div> <div class="example-item" id="0x9ecab2292a2cdd9fbc74993af50fc3f5a4e1c4da69fcc517c5ba5337950b87af-68,,92,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #19</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_19" data-hash="0x9ecab2292a2cdd9fbc74993af50fc3f5a4e1c4da69fcc517c5ba5337950b87af" data-area="68,,92,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '19')" class="rating-up btn btn-success" data-id="rating_19"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'19')" class="rating-down btn btn-danger" data-id="rating_19"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x9ecab2292a2cdd9fbc74993af50fc3f5a4e1c4da69fcc517c5ba5337950b87af-68,,92,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x9ecab2292a2cdd9fbc74993af50fc3f5a4e1c4da69fcc517c5ba5337950b87af&fullName=src%2Fjava%2FReportador.java&project=aesquive%2FNuevoGol')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Faesquive%2FNuevoGol%2Fblob%2Fmaster%2Fsrc%2Fjava%2FReportador.java">Reportador.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Faesquive%2FNuevoGol">aesquive/NuevoGol</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="19"> <pre class="line-numbers language-java" data-end="92" data-start="69" data-highlight="90"> private void guardaRes(String resu, CliGol cliGol) throws ParserConfigurationException, SAXException, IOException { String[] nodos = {"NoHit", "Hit", "Buro"}; DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder(); InputSource is = new InputSource(new StringReader(resu)); Document xml = db.parse(is); Element raiz = xml.getDocumentElement(); String nombre = obtenerNombre(raiz); for (String s : nodos) { Node nodo = raiz.getElementsByTagName(s) == null ? null : raiz.getElementsByTagName(s).item(0); if (nodo != null) { String informacion = sustraerInformacionNodo(cliGol, nodo); guardarEnListas(nodo.getNodeName(), nombre + "," + informacion); } } }</pre> </div> </figure> </div> <div class="example-item" id="0xf0b24fe18745cfaa4f4996065f33a675318932fb2239a7d9c10ebac5367168e7-57,,96,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #20</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_20" data-hash="0xf0b24fe18745cfaa4f4996065f33a675318932fb2239a7d9c10ebac5367168e7" data-area="57,,96,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '20')" class="rating-up btn btn-success" data-id="rating_20"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'20')" class="rating-down btn btn-danger" data-id="rating_20"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xf0b24fe18745cfaa4f4996065f33a675318932fb2239a7d9c10ebac5367168e7-57,,96,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xf0b24fe18745cfaa4f4996065f33a675318932fb2239a7d9c10ebac5367168e7&fullName=android-23%2Forg%2Fw3c%2Fdomts%2Flevel1%2Fhc_nodechildnodes.java&project=RameshByndoor%2Fandroid-sdk-20')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FRameshByndoor%2Fandroid-sdk-20%2Fblob%2Fmaster%2Fandroid-23%2Forg%2Fw3c%2Fdomts%2Flevel1%2Fhc_nodechildnodes.java">hc_nodechildnodes.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FRameshByndoor%2Fandroid-sdk-20">RameshByndoor/android-sdk-20</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="20"> <pre class="line-numbers language-java" data-end="96" data-start="58" data-highlight="88"> /** * Runs the test case. * * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList elementList; Node employeeNode; Node childNode; NodeList childNodes; int nodeType; String childName; java.util.List actual = new java.util.ArrayList(); java.util.List expected = new java.util.ArrayList(); expected.add("em"); expected.add("strong"); expected.add("code"); expected.add("sup"); expected.add("var"); expected.add("acronym"); doc = (Document) load("hc_staff", false); elementList = doc.getElementsByTagName("p"); employeeNode = elementList.item(1); childNodes = employeeNode.getChildNodes(); for (int indexN1006C = 0; indexN1006C < childNodes.getLength(); indexN1006C++) { childNode = (Node) childNodes.item(indexN1006C); nodeType = (int) childNode.getNodeType(); childName = childNode.getNodeName(); if (equals(1, nodeType)) { actual.add(childName); } else { assertEquals("textNodeType", 3, nodeType); } } assertEqualsAutoCase("element", "elementNames", expected, actual); }</pre> </div> </figure> </div> <div class="example-item" id="0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee-870,,905,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #21</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_21" data-hash="0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee" data-area="870,,905,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '21')" class="rating-up btn btn-success" data-id="rating_21"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'21')" class="rating-down btn btn-danger" data-id="rating_21"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee-870,,905,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee&fullName=src%2Fmain%2Fjava%2Fnet%2Fsf%2FXmlToolkit.java&project=rmartony%2Fcomprasestatales')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Frmartony%2Fcomprasestatales%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fnet%2Fsf%2FXmlToolkit.java">XmlToolkit.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Frmartony%2Fcomprasestatales">rmartony/comprasestatales</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="21"> <pre class="line-numbers language-java" data-end="905" data-start="871" data-highlight="888"> /** * Pretty prints a node. * * @param doc The document the node comes from. * @param node The node that should be pretty printed. */ public static void prettyPrint(Document doc, Node node) { // Get the text before the node and extract the indenting Node parent = node.getParentNode(); String indenting = ""; NodeList siblingList = parent.getChildNodes(); for (int i = 1; i < siblingList.getLength(); i++) { Node sibling = siblingList.item(i); if (sibling == node) { Node nodeBefore = siblingList.item(i - 1); // Check whether this is a text node if (nodeBefore.getNodeName().equals("#text")) { // There is text before the node -> Extract the indenting String text = nodeBefore.getNodeValue(); int newlinePos = text.lastIndexOf('\n'); if (newlinePos != -1) { indenting = text.substring(newlinePos); if (indenting.trim().length() != 0) { // The indenting is no whitespace -> Forget it indenting = ""; } } } break; } } // Now pretty print the node prettyPrint(doc, node, indenting); }</pre> </div> </figure> </div> <div class="example-item" id="0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee-907,,940,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #22</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_22" data-hash="0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee" data-area="907,,940,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '22')" class="rating-up btn btn-success" data-id="rating_22"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'22')" class="rating-down btn btn-danger" data-id="rating_22"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee-907,,940,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee&fullName=src%2Fmain%2Fjava%2Fnet%2Fsf%2FXmlToolkit.java&project=rmartony%2Fcomprasestatales')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Frmartony%2Fcomprasestatales%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fnet%2Fsf%2FXmlToolkit.java">XmlToolkit.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Frmartony%2Fcomprasestatales">rmartony/comprasestatales</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="22"> <pre class="line-numbers language-java" data-end="940" data-start="908" data-highlight="923"> /** * Pretty prints a node. * * @param doc The document the node comes from. * @param node The node that should be pretty printed. * @param prefix The prefix the node should get. */ private static void prettyPrint(Document doc, Node node, String prefix) { String childPrefix = prefix + " "; // Add the indenting to the children NodeList childList = node.getChildNodes(); boolean hasChildren = false; for (int i = childList.getLength() - 1; i >= 0; i--) { Node child = childList.item(i); boolean isNormalNode = (!child.getNodeName().startsWith("#")); if (isNormalNode) { // Add the indenting to this node Node textNode = doc.createTextNode(childPrefix); node.insertBefore(textNode, child); // pretty print the child's children prettyPrint(doc, child, childPrefix); hasChildren = true; } } // Add the indenting to the end tag if (hasChildren) { Node textNode = doc.createTextNode(prefix); node.appendChild(textNode); } }</pre> </div> </figure> </div> <div class="example-item" id="0xe344ef20e8394e28dee3dbbfb886c7601b77fea0652dbdd53ae2ac11c08c4378-36,,42,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #23</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_23" data-hash="0xe344ef20e8394e28dee3dbbfb886c7601b77fea0652dbdd53ae2ac11c08c4378" data-area="36,,42,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '23')" class="rating-up btn btn-success" data-id="rating_23"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'23')" class="rating-down btn btn-danger" data-id="rating_23"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xe344ef20e8394e28dee3dbbfb886c7601b77fea0652dbdd53ae2ac11c08c4378-36,,42,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xe344ef20e8394e28dee3dbbfb886c7601b77fea0652dbdd53ae2ac11c08c4378&fullName=src%2Fmain%2Fjava%2Fcom%2Fsuning%2Fsnfddal%2Fconfig%2FXNode.java&project=fengshao0907%2Fjdbc_shard')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Ffengshao0907%2Fjdbc_shard%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fcom%2Fsuning%2Fsnfddal%2Fconfig%2FXNode.java">XNode.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Ffengshao0907%2Fjdbc_shard">fengshao0907/jdbc_shard</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="23"> <pre class="line-numbers language-java" data-end="42" data-start="37" data-highlight="40"> public XNode(XPathParser xpathParser, Node node) { this.xpathParser = xpathParser; this.node = node; this.name = node.getNodeName(); this.attributes = parseAttributes(node); this.body = parseBody(node); }</pre> </div> </figure> </div> <div class="example-item" id="0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee-524,,552,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #24</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_24" data-hash="0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee" data-area="524,,552,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '24')" class="rating-up btn btn-success" data-id="rating_24"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'24')" class="rating-down btn btn-danger" data-id="rating_24"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee-524,,552,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee&fullName=src%2Fmain%2Fjava%2Fnet%2Fsf%2FXmlToolkit.java&project=rmartony%2Fcomprasestatales')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Frmartony%2Fcomprasestatales%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fnet%2Fsf%2FXmlToolkit.java">XmlToolkit.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Frmartony%2Fcomprasestatales">rmartony/comprasestatales</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="24"> <pre class="line-numbers language-java" data-end="552" data-start="525" data-highlight="544,546"> /** * Gets a child node from a parent node. If the parent node has no such child the child of the * <code>defaultNode</code> is used. * * @param node The node to get the child from. * @param defaultNode The node to get the child from if <code>node</code> has no such child. * @param childNodeName The name of the child. * @param mandatory Specifies whether to throw an exception if none of the nodes have such a * child. * @return The child with the given name. * @throws RegainException If both the <code>node</code> and the <code>defaultNode</code> have no * child with the given name and <code>mandatory</code> is <code>true</code>. */ public static Node getCascadedChild( Node node, Node defaultNode, String childNodeName, boolean mandatory) throws RegainException { Node child = getCascadedChild(node, defaultNode, childNodeName); if (mandatory && (child == null)) { throw new RegainException( "Node '" + node.getNodeName() + "' or node '" + defaultNode.getNodeName() + "' must have a child named '" + childNodeName + "'!"); } return child; }</pre> </div> </figure> </div> <div class="example-item" id="0x016370e601948f000b8ab28c9189a5b785925fd1a68f876329237bbc1485439b-77,,84,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #25</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_25" data-hash="0x016370e601948f000b8ab28c9189a5b785925fd1a68f876329237bbc1485439b" data-area="77,,84,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '25')" class="rating-up btn btn-success" data-id="rating_25"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'25')" class="rating-down btn btn-danger" data-id="rating_25"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x016370e601948f000b8ab28c9189a5b785925fd1a68f876329237bbc1485439b-77,,84,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x016370e601948f000b8ab28c9189a5b785925fd1a68f876329237bbc1485439b&fullName=java%2Flibsrc%2Fcom%2Ferissoft%2FXMLUtils.java&project=firstone%2Flatic')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Ffirstone%2Flatic%2Fblob%2Fmaster%2Fjava%2Flibsrc%2Fcom%2Ferissoft%2FXMLUtils.java">XMLUtils.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Ffirstone%2Flatic">firstone/latic</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="25"> <pre class="line-numbers language-java" data-end="84" data-start="78" data-highlight="82"> public static String getAttr(Node node, String name) throws ESException { Attr attr = ((Element) node).getAttributeNode(name); if (attr == null) throw new ESException( "Attribute \"" + name + "\" not " + "found in \"" + node.getNodeName() + "\""); return attr.getNodeValue(); }</pre> </div> </figure> </div> <div class="example-item" id="0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee-125,,178,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #26</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_26" data-hash="0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee" data-area="125,,178,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '26')" class="rating-up btn btn-success" data-id="rating_26"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'26')" class="rating-down btn btn-danger" data-id="rating_26"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee-125,,178,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee&fullName=src%2Fmain%2Fjava%2Fnet%2Fsf%2FXmlToolkit.java&project=rmartony%2Fcomprasestatales')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Frmartony%2Fcomprasestatales%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fnet%2Fsf%2FXmlToolkit.java">XmlToolkit.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Frmartony%2Fcomprasestatales">rmartony/comprasestatales</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="26"> <pre class="line-numbers language-java" data-end="178" data-start="126" data-highlight="137,163"> /** * Prints a XML node. * * @param out The PrintStream where to print the node. * @param prefix The prefix to put before every line. * @param node The node to print. * @throws IOException If printing failed. */ private static void printNode(PrintStream out, String prefix, Node node) throws IOException { prefix = ""; String name = node.getNodeName(); boolean isText = name.equals("#text"); boolean isComment = name.equals("#comment"); boolean isCDATA = name.equals("#cdata-section"); if (isText) { // This is a text tag String text = node.getNodeValue(); text = RegainToolkit.replace(text, "<", "&lt;"); text = RegainToolkit.replace(text, ">", "&gt;"); text = RegainToolkit.replace(text, "--", "&minus;&minus;"); out.print(text); } else if (isComment) { // This is a comment tag String comment = node.getNodeValue(); out.print("<!--" + comment + "-->"); } else if (isCDATA) { String text = node.getNodeValue(); out.print("<![CDATA[" + text + "]]>"); } else { // This is a normal tag out.print(prefix + "<" + name); if (node.hasAttributes()) { NamedNodeMap attributes = node.getAttributes(); for (int i = 0; i < attributes.getLength(); i++) { Node attrib = attributes.item(i); out.print(" " + attrib.getNodeName() + "=\"" + attrib.getNodeValue() + "\""); } } if (!node.hasChildNodes()) { out.print("/>"); } else { out.print(">"); NodeList childList = node.getChildNodes(); String childPrefix = prefix + " "; for (int i = 0; i < childList.getLength(); i++) { printNode(out, childPrefix, childList.item(i)); } out.print(prefix + "</" + name + ">"); } } }</pre> </div> </figure> </div> <div class="example-item" id="0x158ce085ee6716e4608c31277d6b6adca110e4eceeaef82e7e295c931854db2b-74,,90,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #27</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_27" data-hash="0x158ce085ee6716e4608c31277d6b6adca110e4eceeaef82e7e295c931854db2b" data-area="74,,90,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '27')" class="rating-up btn btn-success" data-id="rating_27"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'27')" class="rating-down btn btn-danger" data-id="rating_27"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x158ce085ee6716e4608c31277d6b6adca110e4eceeaef82e7e295c931854db2b-74,,90,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x158ce085ee6716e4608c31277d6b6adca110e4eceeaef82e7e295c931854db2b&fullName=xmlquery%2Fsrc%2Ftest%2Fjava%2Forg%2Fapache%2Foodt%2FQueryElementTest.java&project=fornava%2Foodt')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Ffornava%2Foodt%2Fblob%2Fmaster%2Fxmlquery%2Fsrc%2Ftest%2Fjava%2Forg%2Fapache%2Foodt%2FQueryElementTest.java">QueryElementTest.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Ffornava%2Foodt">fornava/oodt</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="27"> <pre class="line-numbers language-java" data-end="90" data-start="75" data-highlight="79,83,85,87"> public void testXML() throws Exception { QueryElement q1 = new QueryElement("a", "1"); Document doc = XML.createDocument(); Node root = q1.toXML(doc); assertEquals("queryElement", root.getNodeName()); NodeList children = root.getChildNodes(); for (int i = 0; i < children.getLength(); ++i) { Node child = children.item(i); if ("tokenRole".equals(child.getNodeName())) { assertEquals("a", XML.text(child)); } else if ("tokenValue".equals(child.getNodeName())) { assertEquals("1", XML.text(child)); } else fail("Unknown node \"" + child.getNodeName() + "\" in XML result"); } QueryElement q2 = new QueryElement(root); assertEquals(q1, q2); }</pre> </div> </figure> </div> <div class="example-item" id="0x6f4e10d64b7e595959b82cfd6573a8a667e7ac25f12784dcc2289782264ed5e0-18,,25,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #28</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_28" data-hash="0x6f4e10d64b7e595959b82cfd6573a8a667e7ac25f12784dcc2289782264ed5e0" data-area="18,,25,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '28')" class="rating-up btn btn-success" data-id="rating_28"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'28')" class="rating-down btn btn-danger" data-id="rating_28"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x6f4e10d64b7e595959b82cfd6573a8a667e7ac25f12784dcc2289782264ed5e0-18,,25,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x6f4e10d64b7e595959b82cfd6573a8a667e7ac25f12784dcc2289782264ed5e0&fullName=src%2Fmain%2Ffreesql%2Fcn%2Fcom%2Febmp%2Ffreesql%2FXNode.java&project=TuWei1992%2Fzswxsqxt')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FTuWei1992%2Fzswxsqxt%2Fblob%2Fmaster%2Fsrc%2Fmain%2Ffreesql%2Fcn%2Fcom%2Febmp%2Ffreesql%2FXNode.java">XNode.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2FTuWei1992%2Fzswxsqxt">TuWei1992/zswxsqxt</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="28"> <pre class="line-numbers language-java" data-end="25" data-start="19" data-highlight="22"> public XNode(XPathParser xpathParser, Node node, Properties variables) { this.xpathParser = xpathParser; this.node = node; this.name = node.getNodeName(); this.variables = variables; this.attributes = parseAttributes(node); this.body = parseBody(node); }</pre> </div> </figure> </div> <div class="example-item" id="0x111ceb2c744c9374641ed7ee0309b9ecacb288f21636d8d70941f9fea975de97-44,,89,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #29</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_29" data-hash="0x111ceb2c744c9374641ed7ee0309b9ecacb288f21636d8d70941f9fea975de97" data-area="44,,89,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '29')" class="rating-up btn btn-success" data-id="rating_29"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'29')" class="rating-down btn btn-danger" data-id="rating_29"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0x111ceb2c744c9374641ed7ee0309b9ecacb288f21636d8d70941f9fea975de97-44,,89,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0x111ceb2c744c9374641ed7ee0309b9ecacb288f21636d8d70941f9fea975de97&fullName=petascope%2Fsrc%2Fmain%2Fjava%2Fpetascope%2Fwcps%2Fserver%2FFieldName.java&project=diogo-andrade%2FDataHubSystem')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fdiogo-andrade%2FDataHubSystem%2Fblob%2Fmaster%2Fpetascope%2Fsrc%2Fmain%2Fjava%2Fpetascope%2Fwcps%2Fserver%2FFieldName.java">FieldName.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Fdiogo-andrade%2FDataHubSystem">diogo-andrade/DataHubSystem</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="29"> <pre class="line-numbers language-java" data-end="89" data-start="45" data-highlight="46,54"> public FieldName(Node node, XmlQuery xq, CoverageInfo covInfo) throws WCPSException { while ((node != null) && node.getNodeName().equals("#" + WcpsConstants.MSG_TEXT)) { node = node.getNextSibling(); } if (node == null) { throw new WCPSException("FieldNameType parsing error."); } String nodeName = node.getNodeName(); log.trace(nodeName); if (nodeName.equals(WcpsConstants.MSG_NAME)) { this.name = node.getTextContent(); log.trace("Found field name: " + name); String coverageName = covInfo.getCoverageName(); try { covMeta = xq.getMetadataSource().read(coverageName); } catch (Exception ex) { log.error(ex.getMessage()); throw new WCPSException(ex.getMessage(), ex); } try { nameIndex = covMeta.getRangeIndexByName(name).toString(); } catch (PetascopeException ex1) { boolean wrongFieldSubset = true; log.debug("Range field subset " + name + " does not seem by-label: trying by-index."); if (MiscUtil.isInteger(name)) { try { // range subsetting might have been done via range field /index/ (instead of label): // check this is a valid index nameIndex = name; name = covMeta.getRangeNameByIndex(Integer.parseInt(name)); wrongFieldSubset = false; // indeed subset was by-index } catch (PetascopeException ex2) { log.debug("Range field subset " + nameIndex + " is neither a valid index."); } } if (wrongFieldSubset) { log.error("Illegal range field selection: " + name); throw new WCPSException(ex1.getExceptionCode(), ex1.getExceptionText()); } } } }</pre> </div> </figure> </div> <div class="example-item" id="0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee-200,,216,"> <div class="bs-example"> <div> <div class="bs-example-title">コード例 #30</div> <div style="position: absolute;right: 15px;top: 10px;" id="rating_30" data-hash="0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee" data-area="200,,216,"> <div class="rating-amount">0</div> <a title="この例に高評価をつける" href="javascript:app.addRating(1, '30')" class="rating-up btn btn-success" data-id="rating_30"><i class="icon-button icon-thumbs-up"></i></a> <a title="この例に低評価をつける" href="javascript:app.addRating(-1,'30')" class="rating-down btn btn-danger" data-id="rating_30"><i class="icon-button icon-thumbs-down"></i></a> </div> </div> <div style="display:flex;align-items: center;flex-wrap: wrap"> <div style="display: inline-block;margin-right: 10px"> <a class="btn btn-default" title="この例への直リンク" href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html#0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee-200,,216,"><i class="icon-button icon-link"></i></a> <a rel="nofollow" class="btn btn-default" href="javascript:app.open('https://java.hotexamples.com/jp/site/file?hash=0xe4b11cf776f1da0c69bd11377b73b77ab04e3963800c7de0c6bf190134e545ee&fullName=src%2Fmain%2Fjava%2Fnet%2Fsf%2FXmlToolkit.java&project=rmartony%2Fcomprasestatales')">ファイルを表示</a> </div> <div class="example-project-info"> <nobr> <span>ファイル:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Frmartony%2Fcomprasestatales%2Fblob%2Fmaster%2Fsrc%2Fmain%2Fjava%2Fnet%2Fsf%2FXmlToolkit.java">XmlToolkit.java</a> </nobr> <nobr> <span>プロジェクト:</span> <a target="_blank" rel="nofollow" href="https://java.hotexamples.com/jp/site/redirect?url=https%3A%2F%2Fgithub.com%2Frmartony%2Fcomprasestatales">rmartony/comprasestatales</a> </nobr> </div> </div> </div> <figure class="highlight"> <div class="example" data-id="30"> <pre class="line-numbers language-java" data-end="216" data-start="201" data-highlight="215"> /** * Extrahiert den Text eines Knotens, wandelt ihn in ein int und gibt das Ergebnis zurück. * * @param node Der Knoten, dessen Text zurückgeben werden soll. * @return Der Text des Knotens als int. * @throws RegainException Falls der Knoten keinen Text hat oder falls der Text keine Ganzzahl * ist. */ public static int getTextAsInt(Node node) throws RegainException { String asString = getText(node, true, true); try { return Integer.parseInt(asString); } catch (NumberFormatException exc) { throw new RegainException( "Value of node '" + node.getNodeName() + "' must be an integer: '" + asString + "'", exc); } }</pre> </div> </figure> </div> <div id="all-examples"></div> </div> </div> </div> <div class="page-side-banner hidden-xs hidden-sm hidden-md" style="width:300px"> <div id="ezoic-pub-ad-placeholder-131"> <div class="fx" style="width:300px"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- right-sidebar-fx --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3697522372581514" data-ad-slot="8968655429" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> </div> </div> </div> <footer class="footer"> <div class="container"> <div class="row"> <div class="col-md-12" style="text-align: center"> <a href="https://java.hotexamples.com/jp/site/trends?type=java%7Cc"> 上位のクラス </a> | <a href="/site/privacy">個人情報保護方針</a> | <a href="https://cpp.hotexamples.com/direct-sales.html">Advertise with us</a> </div> </div> <div class="row"> <div class="col-md-12" style="text-align: center"> <a href="https://hotexamples.com/jp/">PHP</a> | <a href="https://csharp.hotexamples.com/jp/">C# (CSharp)</a> | <a href="https://java.hotexamples.com/jp/">Java</a> | <a href="https://golang.hotexamples.com/jp/">Golang</a> | <a href="https://cpp.hotexamples.com/jp/">C++ (Cpp)</a> | <a href="https://python.hotexamples.com/jp/">Python</a> | <a href="https://javascript.hotexamples.com/jp/">JavaScript</a> | <a href="https://typescript.hotexamples.com/jp/">TypeScript</a> </div> </div> <div class="row"> <div class="col-md-12" style="text-align: center"> <a href="https://java.hotexamples.com/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html">EN</a> | <a href="https://java.hotexamples.com/ru/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html">RU</a> | <a href="https://java.hotexamples.com/de/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html">DE</a> | <a href="https://java.hotexamples.com/fr/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html">FR</a> | <a href="https://java.hotexamples.com/es/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html">ES</a> | <a href="https://java.hotexamples.com/pt/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html">PT</a> | <a href="https://java.hotexamples.com/it/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html">IT</a> | <a href="https://java.hotexamples.com/jp/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html">JP</a> | <a href="https://java.hotexamples.com/zh/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html">ZH</a> | <a href="https://java.hotexamples.com/ko/examples/-/Node/getNodeName/java-node-getnodename-method-examples.html">KO</a> </div> </div> <div class="row"> <div class="col-md-10 col-md-offset-1"> </div> <div class="col-md-1"> <!--LiveInternet counter--> <script type="text/javascript"><!-- document.write("<a href='//www.liveinternet.ru/click' " + "target=_blank><img src='//counter.yadro.ru/hit?t44.6;r" + escape(document.referrer) + ((typeof (screen) == "undefined") ? "" : ";s" + screen.width + "*" + screen.height + "*" + (screen.colorDepth ? screen.colorDepth : screen.pixelDepth)) + ";u" + escape(document.URL) + ";" + Math.random() + "' alt='' title='LiveInternet' " + "border='0' width='31' height='31'><\/a>"); //--></script><!--/LiveInternet--> </div> </div> </div> </footer> <script src="//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="/assets/30dd86a6f06b64184847037c52c63e07aa3c9a26.js"></script> <script>jQuery(function ($) { jQuery('#search-form').yiiActiveForm([{"id":"searchform-lang","name":"lang","container":".field-searchform-lang","input":"#searchform-lang","enableAjaxValidation":true},{"id":"searchform-search","name":"search","container":".field-searchform-search","input":"#searchform-search","enableAjaxValidation":true,"validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Search cannot be blank."});}}], []); });</script></body> </html>