1 26 27 package org.objectweb.jonas_lib.deployment.xml; 28 29 import javax.xml.namespace.QName ; 30 31 36 public class Qname extends AbsElement { 37 38 41 private String name = null; 42 43 46 private QName qName = null; 47 48 49 52 public Qname() { 53 super(); 54 } 55 56 57 59 63 public void setQName(QName qName) { 64 this.qName = qName; 65 } 66 67 71 public void setName(String name) { 72 this.name = name; 73 } 74 75 77 80 public QName getQName() { 81 return qName; 82 } 83 84 85 86 91 public String toXML(int indent) { 92 StringBuffer sb = new StringBuffer (); 93 sb.append(indent(indent)); 94 String prefix = "pr"; 96 97 if (qName == null) { 98 return ""; 99 } 100 101 String namespaceURI = qName.getNamespaceURI(); 102 String localPart = qName.getLocalPart(); 103 104 105 sb.append("<"); 106 sb.append(name); 107 sb.append(" xmlns:"); 108 sb.append(prefix); 109 sb.append("=\""); 110 sb.append(namespaceURI); 111 sb.append("\">"); 112 sb.append(prefix); 113 sb.append(":"); 114 sb.append(localPart); 115 sb.append("</"); 116 sb.append(name); 117 sb.append(">\n"); 118 119 return sb.toString(); 120 } 121 122 } 123 | Popular Tags |