1 46 package groovy.xml; 47 48 import java.util.Map ; 49 50 import groovy.util.BuilderSupport; 51 52 53 59 public class Namespace extends BuilderSupport { 60 61 private Object builder; 62 private String uri; 63 private String prefix; 64 65 public Namespace(BuilderSupport builder, String uri) { 66 this(builder, uri, ""); 67 } 68 69 public Namespace(BuilderSupport builder, String uri, String prefix) { 70 super(builder); 71 this.builder = builder; 72 this.uri = uri; 73 this.prefix = prefix; 74 } 75 76 protected void setParent(Object parent, Object child) { 77 } 78 79 protected Object getName(String methodName) { 80 QName qname = new QName(uri, methodName, prefix); 81 return qname; 82 } 83 84 protected Object createNode(Object name) { 85 return name; 86 } 87 88 protected Object createNode(Object name, Object value) { 89 return name; 90 } 91 92 protected Object createNode(Object name, Map attributes) { 93 return name; 94 } 95 96 protected Object createNode(Object name, Map attributes, Object value) { 97 return name; 98 } 99 } 100 | Popular Tags |