X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fcommons%2Fdata%2Fxml%2FXmlElement.java;fp=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fcommons%2Fdata%2Fxml%2FXmlElement.java;h=0000000000000000000000000000000000000000;hb=835e4e7c1c7313e609a958b5f685506ecace76f4;hp=27cac0e16647bef7e667e3593de86b2560afd70b;hpb=929ec66ff0f0f684d1f06bd2eac22323a10022b1;p=svjatoslav_commons.git diff --git a/src/main/java/eu/svjatoslav/commons/data/xml/XmlElement.java b/src/main/java/eu/svjatoslav/commons/data/xml/XmlElement.java deleted file mode 100755 index 27cac0e..0000000 --- a/src/main/java/eu/svjatoslav/commons/data/xml/XmlElement.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 3 of the GNU Lesser General Public License - * or later as published by the Free Software Foundation. - */ - -package eu.svjatoslav.commons.data.xml; - -import java.util.ArrayList; -import java.util.List; - -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; - -public class XmlElement { - - Element element; - - public XmlElement(final Element element) { - this.element = element; - } - - public List getAttributeNames() { - final ArrayList result = new ArrayList(); - - final NamedNodeMap attributes = element.getAttributes(); - - for (int i = 0; i < attributes.getLength(); i++) { - final Node node = attributes.item(i); - - result.add(node.getNodeName()); - } - - return result; - } - - public String getAttributeValue(final String attributeName) { - return element.getAttribute(attributeName); - } - - @Override - public String toString() { - final StringBuffer result = new StringBuffer(); - - result.append("node name: " + element.getNodeName() + "\n"); - - final NamedNodeMap attributes = element.getAttributes(); - - for (int i = 0; i < attributes.getLength(); i++) { - final Node node = attributes.item(i); - - result.append(" " + node.getNodeName() + "\n"); - } - - return result.toString(); - } - -}