1 20 21 package org.jivesoftware.smack.packet; 22 23 import java.util.Map ; 24 import java.util.Iterator ; 25 26 49 public class Registration extends IQ { 50 51 private String instructions = null; 52 private Map attributes = null; 53 54 61 public String getInstructions() { 62 return instructions; 63 } 64 65 70 public void setInstructions(String instructions) { 71 this.instructions = instructions; 72 } 73 74 79 public Map getAttributes() { 80 return attributes; 81 } 82 83 88 public void setAttributes(Map attributes) { 89 this.attributes = attributes; 90 } 91 92 public String getChildElementXML() { 93 StringBuffer buf = new StringBuffer (); 94 buf.append("<query xmlns=\"jabber:iq:register\">"); 95 if (instructions != null) { 96 buf.append("<instructions>").append(instructions).append("</instructions>"); 97 } 98 if (attributes != null && attributes.size() > 0) { 99 Iterator fieldNames = attributes.keySet().iterator(); 100 while (fieldNames.hasNext()) { 101 String name = (String )fieldNames.next(); 102 String value = (String )attributes.get(name); 103 buf.append("<").append(name).append(">"); 104 buf.append(value); 105 buf.append("</").append(name).append(">"); 106 } 107 } 108 buf.append(getExtensionsXML()); 110 buf.append("</query>"); 111 return buf.toString(); 112 } 113 } | Popular Tags |