Update of /var/cvs/src/org/mmbase/util/xml
In directory james.mmbase.org:/tmp/cvs-serv4583
Modified Files:
DocumentReader.java
Log Message:
some of these methods can as well be static, because don't use any members, and
it is unimaginable that one woudl override them
See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/util/xml
Index: DocumentReader.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/util/xml/DocumentReader.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- DocumentReader.java 3 Sep 2008 16:30:15 -0000 1.41
+++ DocumentReader.java 3 Sep 2008 19:09:30 -0000 1.42
@@ -40,7 +40,7 @@
* @author Rico Jansen
* @author Pierre van Rooden
* @author Michiel Meeuwissen
- * @version $Id: DocumentReader.java,v 1.41 2008/09/03 16:30:15 michiel Exp $
+ * @version $Id: DocumentReader.java,v 1.42 2008/09/03 19:09:30 michiel Exp $
* @since MMBase-1.7
*/
public class DocumentReader {
@@ -499,7 +499,7 @@
* @param path Dot-separated list of tags describing path from root
element to requested element
* @return Leaf element of the path
*/
- public Element getElementByPath(Element e, String path) {
+ public static Element getElementByPath(Element e, String path) {
StringTokenizer st = new StringTokenizer(path,".");
if (!st.hasMoreTokens()) {
// faulty path
@@ -513,8 +513,8 @@
return null;
} else if (!e.getLocalName().equals(root)) {
// path should start with document root element
- log.error("path ["+path+"] with root ("+root+") doesn't start
with root element ("+e.getLocalName()+"): incorrect xml file" +
- "("+getSystemId()+")");
+ log.error("path [" + path + "] with root (" + root + ")
doesn't start with root element (" + e.getLocalName() + "): incorrect xml file"
+
+ "(" + e.getOwnerDocument().getDocumentURI() + ")");
return null;
}
OUTER:
@@ -546,7 +546,7 @@
* @param e Element
* @return Text value of element
*/
- public String getElementValue(Element e) {
+ public static String getElementValue(Element e) {
if (e == null) {
return "";
} else {
@@ -566,8 +566,8 @@
* @param e Element
* @return a <code>List</code> of child elements
*/
- public List<Element> getChildElements(Element e) {
- return getChildElements(e,"*");
+ public static List<Element> getChildElements(Element e) {
+ return getChildElements(e, "*");
}
/**
@@ -575,8 +575,8 @@
* @param tag tag to match ("*" means all tags")
* @return a <code>List</code> of child elements with the given tag
*/
- public List<Element> getChildElements(String path,String tag) {
- return getChildElements(getElementByPath(path),tag);
+ public List<Element> getChildElements(String path, String tag) {
+ return getChildElements(getElementByPath(path), tag);
}
/**
@@ -584,7 +584,7 @@
* @param tag tag to match ("*" means all tags")
* @return a <code>List</code> of child elements with the given tag
*/
- public List<Element> getChildElements(Element e, String tag) {
+ public static List<Element> getChildElements(Element e, String tag) {
List<Element> v = new ArrayList<Element>();
boolean ignoretag = tag.equals("*");
if (e!=null) {
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs