⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 discofeature.java

📁 一款即时通讯软件
💻 JAVA
字号:
package edu.ou.kmi.buddyspace.plugins.disco.xml;

/*
 * DiscoFeature.java
 *
 * Project: BuddySpace
 * (C) Copyright Knowledge Media Institute 2003
 *
 *
 * Created on 20 August 2003, 8:51
 */

import java.io.Serializable;
import java.util.*;
import org.jabber.jabberbeans.util.*;
import org.jabber.jabberbeans.*;
import org.jabber.jabberbeans.Extension.*;
import org.xml.sax.AttributeList;
import org.xml.sax.helpers.AttributeListImpl;

/**
 * <code>DiscoFeature</code> contains &lt;feature&gt tag from disco#info.
 *
 * @author  Jiri Komzak, Knowledge Media Institute, Open University, United Kingdom
 */
public class DiscoFeature
    extends XMLData
    implements QueryExtension
{
    /** Attributes. */
    private AttributeList attributes;
    
    /**
     * Creates a new <code>DiscoFeature</code> instance, based on the builder
     * state.
     *
     * @param builder an <code>DiscoFeatureBuilder</code> value
     * @exception InstantiationException if malformed or insufficient data is
     * in the builder.
     */
    public DiscoFeature(DiscoFeatureBuilder builder)
        throws InstantiationException
    {
        attributes = builder.getAttributes();
    }
    
    
    public String getAttribute(String name) {
        return (attributes == null || name == null)? null : attributes.getValue(name);
    }
    
    
    /**
     * <code>appendItem</code> appends the XML representation of the
     * current packet data to the specified <code>StringBuffer</code>.
     *
     * @param retval The <code>StringBuffer</code> to append to
     */
    public void appendItem(StringBuffer retval)
    {
	retval.append("<feature");
        
        for (int i=0; attributes != null && i < attributes.getLength(); i++) {
            appendAttrib(retval, attributes.getName(i), attributes.getValue(i));
        }
        
        retval.append("/>");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -