Class DataForm.Builder

java.lang.Object
org.jivesoftware.smackx.xdata.packet.DataForm.Builder
Enclosing class:
DataForm

public static final class DataForm.Builder extends Object
  • Method Details

    • setTitle

      Sets the description of the data. It is similar to the title on a web page or an X window. You can put a <title/> on either a form to fill out, or a set of data results.
      Parameters:
      title - description of the data.
      Returns:
      a reference to this builder.
    • addField

      Adds a new field as part of the form.
      Parameters:
      field - the field to add to the form.
      Returns:
      a reference to this builder.
    • addFields

      public DataForm.Builder addFields(Collection<? extends FormField> fieldsToAdd)
      Add the given fields to this form.
      Parameters:
      fieldsToAdd - TODO javadoc me please
      Returns:
      a reference to this builder.
    • removeField

      public DataForm.Builder removeField(String fieldName)
    • setFormType

      public DataForm.Builder setFormType(String formType)
    • setInstructions

      public DataForm.Builder setInstructions(String instructions)
    • setInstructions

      public DataForm.Builder setInstructions(List<String> instructions)
      Sets the list of instructions that explain how to fill out the form and what the form is about. The dataform could include multiple instructions since each instruction could not contain newlines characters.
      Parameters:
      instructions - list of instructions that explain how to fill out the form.
      Returns:
      a reference to this builder.
    • addInstruction

      public DataForm.Builder addInstruction(String instruction)
      Adds a new instruction to the list of instructions that explain how to fill out the form and what the form is about. The dataform could include multiple instructions since each instruction could not contain newlines characters.
      Parameters:
      instruction - the new instruction that explain how to fill out the form.
      Returns:
      a reference to this builder.
    • addItem

      Adds a new item returned from a search.
      Parameters:
      item - the item returned from a search.
      Returns:
      a reference to this builder.
    • setReportedData

      Sets the fields that will be returned from a search.
      Parameters:
      reportedData - the fields that will be returned from a search.
      Returns:
      a reference to this builder.
    • addExtensionElement

    • build

      public DataForm build()