📄 iqregisterbuilder.java
字号:
/*
* License
*
* The contents of this file are subject to the Jabber Open Source License
* Version 1.0 (the "License"). You may not copy or use this file, in either
* source code or executable form, except in compliance with the License. You
* may obtain a copy of the License at http://www.jabber.com/license/ or at
* http://www.opensource.org/.
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Copyrights
*
* Portions created by or assigned to Jabber.com, Inc. are
* Copyright (c) 2000 Jabber.com, Inc. All Rights Reserved. Contact
* information for Jabber.com, Inc. is available at http://www.jabber.com/.
*
* Portions Copyright (c) 1999-2000 David Waite
*
* Acknowledgements
*
* Special thanks to the Jabber Open Source Contributors for their
* suggestions and support of Jabber.
*
* Changes
*
* @author $Author: chris $
* @version $Revision: 1.1 $
*
* j.komzak
* Added handling of embedded extensions (like jabber:x:data for forms).
*/
package edu.ou.kmi.buddyspace.xml;
import java.util.*;
import org.jabber.jabberbeans.Extension.Extension;
import org.jabber.jabberbeans.Extension.HashExtensionBuilder;
/**
* An <code>IQRegisterBuilder</code> is used to generate an
* IQRegister Extension, which is used in registering for jabber in general,
* or specific transports.
*
* NOTE: it is my personal hope that this extension dies a horrible death at
* a later date, probably at the hand of XML forms.
*
* all parameters are subject to interpretation - the names are meant to be
* labels to editable text boxes, with instructions being broadcast on how to
* use the interface.
*
* also note that the values do not have default states - <name/> is
* represented by name.equals(""), whereas name=null indicates the element
* is not present
*
* @see QueryExtension
*
* @author David Waite <a href="mailto:dwaite@jabber.com">
* <i><dwaite@jabber.com></i></a>
* @author $Author: chris $
* @version $Revision: 1.1 $
*
* @author Jiri Komzak <a href="mailto:j.komzak@open.ac.uk">
* <i><j.komzak@open.ac.uk></i></a>
* @author $Author: chris $
* @version $Revision: 1.1 $
*/
public class IQRegisterBuilder extends HashExtensionBuilder {
/** Vector of extension objects contained. */
private Vector extensions;
/**
* Construct a new IQRegisterExtensionBuilder object
*/
public IQRegisterBuilder()
{
super();
reset();
}
/**
* <code>reset</code> clears all data values (sets to null), so that the
* builder may be reused.
*/
public void reset()
{
super.reset();
extensions = new Vector();
}
/**
* <code>addExtension</code> adds a new child tag object to the end of this
* list.
*
* @param layer an <code>Extension</code> value
*/
public void addExtension(Extension extension)
{
if (!extensions.contains(extension))
extensions.addElement(extension);
}
/**
* <code>extensions</code> returns the vector representing the extensions
* objects associated with this object.
*
* @return a <code>Vector</code> value
*/
public Vector extensions() {
return extensions;
}
/**
* Construct an <code>IQRegsiterExtension Extension</code> object
*
* @return Extension object based on current internal state of the builder
*/
public Extension build()
throws InstantiationException
{
return new IQRegister(this);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -