package nu.fw.jeti.jabber.elements; import java.util.Collections; import java.util.Iterator; import java.util.List; import nu.fw.jeti.jabber.Backend; import nu.fw.jeti.jabber.JID; /** * @author E.S. de Boer * @version 1.0 */ public class IQBrowse extends Extension implements IQExtension, DiscoveryItem, DiscoveryInfo { private List namespaces; private String name; private String type; private String category; private String version; private JID jid; private List childItems; public IQBrowse() { } public IQBrowse(JID jid) { this.jid = jid; } public IQBrowse(IQBrowseBuilder ib) { name = ib.getName(); jid = ib.getJID(); category = ib.getCategory(); type = ib.getType(); version = ib.getVersion(); namespaces = ib.getNamespaces(); childItems = ib.getItems(); } public String getName(){return name;} public String getType(){return type;} public String getCategory(){return category;} public JID getJID(){return jid;} public Iterator getItems() { if(childItems == null) return null; return childItems.iterator(); } public int getSize() { if(childItems == null) return 0; return childItems.size(); } public boolean hasItems(){return childItems != null;} public List getFeatures() { return Collections.unmodifiableList(namespaces); } // public StringArray getNamespaces() // { // return namespaces; // } public boolean hasFeatures(){return namespaces != null;} public void appendToXMLNoIQ(StringBuffer xml) { xml.append(""); return; } xml.append('>'); if(namespaces !=null) { for(Iterator i = namespaces.iterator();i.hasNext();) { appendElement(xml,"ns",i.next()); } } if(childItems != null) { for(Iterator i = childItems.iterator();i.hasNext();) { ((IQBrowse)i.next()).appendToXMLNoIQ(xml); } } xml.append(""); } } /* * Overrides for emacs * Local variables: * tab-width: 4 * End: */