/* * Jeti, a Java Jabber client, Copyright (C) 2003 E.S. de Boer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * For questions, comments etc, * use the website at http://jeti.jabberstudio.org * or mail/IM me at jeti@jabber.org * * Created on 26-apr-2003 */ package nu.fw.jeti.jabber.elements; 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 * implements the http://jabber.org/protocol/disco#items'/ spec */ public class IQDiscoItems extends Extension implements IQExtension, DiscoveryItem { private String node; private List items; public IQDiscoItems() {} public IQDiscoItems(String node) { this.node = node; } public IQDiscoItems(String node,List items) { this.node = node; this.items = items; } public String getNode() { return node; } public Iterator getItems() { if (items == null)return null; return items.iterator(); } public int getSize() { if (items == null)return 0; return items.size(); } public boolean hasItems() { return items != null; } //---------------------------discoveryInfo implementation, returns null-------------- public JID getJID() { return null; } public String getName() { return null; } //---------------------------------------------------------------------------- public void execute(InfoQuery iq,Backend backend){} public void appendToXML(StringBuffer xml) { xml.append(""); return; } xml.append('>'); if (items != null) { for (Iterator i = items.iterator(); i.hasNext();) { ((DiscoItem) i.next()).appendToXML(xml); } } xml.append(""); } } /* * Overrides for emacs * Local variables: * tab-width: 4 * End: */