1 package org.apache.velocity.anakia; 2 3 18 19 import org.jdom.Element; 20 import org.jdom.Namespace; 21 import org.jdom.output.XMLOutputter; 22 import java.util.List ; 23 24 33 public class AnakiaElement extends Element 34 { 35 private static final XMLOutputter DEFAULT_OUTPUTTER = new XMLOutputter(); 36 37 49 public AnakiaElement(String name, Namespace namespace) 50 { 51 super(name, namespace); 52 } 53 54 62 public AnakiaElement(String name) 63 { 64 super(name); 65 } 66 67 80 public AnakiaElement(String name, String uri) 81 { 82 super(name, uri); 83 } 84 85 97 public AnakiaElement(String name, String prefix, String uri) 98 { 99 super(name, prefix, uri); 100 } 101 102 116 public NodeList selectNodes(String xpathExpression) 117 { 118 return new NodeList(XPathCache.getXPath(xpathExpression).applyTo(this), false); 119 } 120 121 125 public String toString() 126 { 127 return DEFAULT_OUTPUTTER.outputString(this); 128 } 129 130 148 public List getContent() 149 { 150 return new NodeList(super.getContent(), false); 151 } 152 153 179 public List getChildren() 180 { 181 return new NodeList(super.getChildren(), false); 182 } 183 184 202 public List getChildren(String name) 203 { 204 return new NodeList(super.getChildren(name)); 205 } 206 207 226 public List getChildren(String name, Namespace ns) 227 { 228 return new NodeList(super.getChildren(name, ns)); 229 } 230 231 242 public List getAttributes() 243 { 244 return new NodeList(super.getAttributes()); 245 } 246 } 247 | Popular Tags |