Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.forms.spi
Class XFormFieldImpl

java.lang.Object
  extended by org.jivesoftware.wildfire.forms.spi.XFormFieldImpl
All Implemented Interfaces:
FormField

public class XFormFieldImpl
extends Object
implements FormField

A concrete FormField capable of sending itself to a writer and recover its state from an XMPP stanza.

Author:
gdombiak

Field Summary
 
Fields inherited from interface org.jivesoftware.wildfire.forms.FormField
TYPE_BOOLEAN, TYPE_FIXED, TYPE_HIDDEN, TYPE_JID_MULTI, TYPE_JID_SINGLE, TYPE_LIST_MULTI, TYPE_LIST_SINGLE, TYPE_TEXT_MULTI, TYPE_TEXT_PRIVATE, TYPE_TEXT_SINGLE
 
Constructor Summary
XFormFieldImpl()
           
XFormFieldImpl(String variable)
           
 
Method Summary
 void addOption(String label, String value)
          Adds an available option to the question that the user has in order to answer the question.
 void addValue(String value)
          Adds a default value to the question if the question is part of a form to fill out.
 org.dom4j.Element asXMLElement()
           
 void clearValues()
          Removes all the values of the field.
 String getDescription()
          Returns a description that provides extra clarification about the question.
 String getLabel()
          Returns the label of the question which should give enough information to the user to fill out the form.
 String getName()
           
 String getNamespace()
           
 String getType()
          Returns an indicative of the format for the data to answer.
 Iterator<String> getValues()
          Returns an Iterator for the default values of the question if the question is part of a form to fill out.
 String getVariable()
          Returns the variable name that the question is filling out.
 boolean isRequired()
          Returns true if the question must be answered in order to complete the questionnaire.
 void parse(org.dom4j.Element formElement)
           
 void setDescription(String description)
          Sets a description that provides extra clarification about the question.
 void setLabel(String label)
          Sets the label of the question which should give enough information to the user to fill out the form.
 void setName(String name)
           
 void setNamespace(String namespace)
           
 void setRequired(boolean required)
          Sets if the question must be answered in order to complete the questionnaire.
 void setType(String type)
          Sets an indicative of the format for the data to answer.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XFormFieldImpl

public XFormFieldImpl()

XFormFieldImpl

public XFormFieldImpl(String variable)
Method Detail

getNamespace

public String getNamespace()

setNamespace

public void setNamespace(String namespace)

getName

public String getName()

setName

public void setName(String name)

asXMLElement

public org.dom4j.Element asXMLElement()

addValue

public void addValue(String value)
Description copied from interface: FormField
Adds a default value to the question if the question is part of a form to fill out. Otherwise, adds an answered value to the question.

Specified by:
addValue in interface FormField
Parameters:
value - a default value or an answered value of the question.

clearValues

public void clearValues()
Description copied from interface: FormField
Removes all the values of the field.

Specified by:
clearValues in interface FormField

addOption

public void addOption(String label,
                      String value)
Description copied from interface: FormField
Adds an available option to the question that the user has in order to answer the question.

Specified by:
addOption in interface FormField
Parameters:
label - a label that represents the option.
value - the value of the option.

setType

public void setType(String type)
Description copied from interface: FormField
Sets an indicative of the format for the data to answer. Valid formats are:

Specified by:
setType in interface FormField
Parameters:
type - an indicative of the format for the data to answer.

setRequired

public void setRequired(boolean required)
Description copied from interface: FormField
Sets if the question must be answered in order to complete the questionnaire.

Specified by:
setRequired in interface FormField
Parameters:
required - if the question must be answered in order to complete the questionnaire.

setLabel

public void setLabel(String label)
Description copied from interface: FormField
Sets the label of the question which should give enough information to the user to fill out the form.

Specified by:
setLabel in interface FormField
Parameters:
label - the label of the question.

setDescription

public void setDescription(String description)
Description copied from interface: FormField
Sets a description that provides extra clarification about the question. This information could be presented to the user either in tool-tip, help button, or as a section of text before the question.

If the question is of type FIXED then the description should remain empty.

Specified by:
setDescription in interface FormField
Parameters:
description - provides extra clarification about the question.

isRequired

public boolean isRequired()
Description copied from interface: FormField
Returns true if the question must be answered in order to complete the questionnaire.

Specified by:
isRequired in interface FormField
Returns:
true if the question must be answered in order to complete the questionnaire.

getVariable

public String getVariable()
Description copied from interface: FormField
Returns the variable name that the question is filling out.

Specified by:
getVariable in interface FormField
Returns:
the variable name of the question.

getValues

public Iterator<String> getValues()
Description copied from interface: FormField
Returns an Iterator for the default values of the question if the question is part of a form to fill out. Otherwise, returns an Iterator for the answered values of the question.

Specified by:
getValues in interface FormField
Returns:
an Iterator for the default values or answered values of the question.

getType

public String getType()
Description copied from interface: FormField
Returns an indicative of the format for the data to answer. Valid formats are:

Specified by:
getType in interface FormField
Returns:
format for the data to answer.

getLabel

public String getLabel()
Description copied from interface: FormField
Returns the label of the question which should give enough information to the user to fill out the form.

Specified by:
getLabel in interface FormField
Returns:
label of the question.

getDescription

public String getDescription()
Description copied from interface: FormField
Returns a description that provides extra clarification about the question. This information could be presented to the user either in tool-tip, help button, or as a section of text before the question.

If the question is of type FIXED then the description should remain empty.

Specified by:
getDescription in interface FormField
Returns:
description that provides extra clarification about the question.

parse

public void parse(org.dom4j.Element formElement)

toString

public String toString()
Overrides:
toString in class Object

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.