pubsubsubscribeopt.java

来自「一款即时通讯软件」· Java 代码 · 共 65 行

JAVA
65
字号
package edu.ou.kmi.buddyspace.plugins.pubsub.xml;

/*
 * PubsubSubscribeOpt.java
 *
 * Project: BuddySpace
 * (C) Copyright Knowledge Media Institute 2003
 *
 *
 * Created on 10 October 2003, 9:25
 */

import java.util.*;
import org.jabber.jabberbeans.util.*;
import org.jabber.jabberbeans.*;
import org.jabber.jabberbeans.Extension.*;

/**
 * <code>PubsubPublish</code> contains &lt;subscribe-options&gt tag
 * from pubsub.
 *
 * @author  Jiri Komzak, Knowledge Media Institute, Open University, United Kingdom
 */
public class PubsubSubscribeOpt
    extends XMLData
{
    /** required */
    private boolean required;
    
    /**
     * Creates a new <code>PubsubSubscribeOpt</code> instance, based on the builder
     * state.
     *
     * @param builder an <code>PubsubSubscribeOptBuilder</code> value
     * @exception InstantiationException if malformed or insufficient data is
     * in the builder.
     */
    public PubsubSubscribeOpt(PubsubSubscribeOptBuilder builder)
        throws InstantiationException
    {
        required = builder.isRequired();
    }
    
    
    public boolean isRequired() {
        return required;
    }
    
    /**
     * <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("<subscribe-options");
        
        if (required)
            retval.append("><required/></subscribe-options>");
        else
            retval.append("/>");
    }
}

⌨️ 快捷键说明

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