public class JabberDataElement extends ElementWrapper
Constructor and Description |
---|
JabberDataElement(Element x)
Creates instance of JabberDataElement and parse fields.
|
JabberDataElement(XDataType type)
Creates empty form instance.
|
Modifier and Type | Method and Description |
---|---|
BooleanField |
addBooleanField(String var,
Boolean value)
Adds boolean field to form.
|
protected void |
addField(AbstractField<?> f) |
FixedField |
addFixedField(String value)
Adds fixed field to form.
|
FixedField |
addFixedField(String var,
String value)
Adds fixed field to form.
|
void |
addFORM_TYPE(String value)
Adds field "FORM_TYPE" hidded field to form.
|
HiddenField |
addHiddenField(String var,
String value)
Adds hidden field to form.
|
JidMultiField |
addJidMultiField(String var,
JID... value)
Adds jid-multi field to form.
|
JidSingleField |
addJidSingleField(String var,
JID value)
Adds jid-single field to form.
|
ListMultiField |
addListMultiField(String var,
String... value)
Adds list-multi field to form.
|
ListSingleField |
addListSingleField(String var,
String value)
Adds list-single field to form.
|
TextMultiField |
addTextMultiField(String var,
String... value)
Adds text-multi field to form.
|
TextPrivateField |
addTextPrivateField(String var,
String value)
Adds text-private field to form.
|
TextSingleField |
addTextSingleField(String var,
String value)
Adds text-single field to form.
|
void |
cleanUpForm() |
Element |
createSubmitableElement(XDataType type)
Creates XML Element contains only values of fields.
|
String |
getAsString()
Get this element as XML string.
|
<X extends AbstractField<?>> |
getField(int row,
String var) |
<X extends AbstractField<?>> |
getField(String var)
Returns field with given name.
|
ArrayList<AbstractField<?>> |
getFields()
Returns all fields of form.
|
List<AbstractField<?>> |
getFields(boolean includeHidden) |
static String[] |
getFieldValueAsStringArray(AbstractField field) |
String |
getInstructions()
Returns natural language instruction.
|
int |
getRowsCount() |
String |
getTitle()
Returns title.
|
XDataType |
getType()
Return data type.
|
void |
setInstructions(String instructions)
Sets natural-language instruction.
|
void |
setTitle(String title)
Sets form title.
|
addChild, equals, findChild, getAttribute, getAttributes, getChildAfter, getChildElementValue, getChildElementValue, getChildren, getChildren, getChildrenNS, getChildrenNS, getFirstChild, getFirstChild, getName, getNextSibling, getParent, getValue, getWrappedElement, getXMLNS, hashCode, removeAttribute, removeChild, setAttribute, setAttributes, setChildElementValue, setChildElementValue, setParent, setValue, setXMLNS, toString
public JabberDataElement(Element x) throws JaxmppException
x
- <x xmlns='jabber:x:data'/> element.JaxmppException
public JabberDataElement(XDataType type) throws XMLException
type
- type of data.XMLException
public static String[] getFieldValueAsStringArray(AbstractField field) throws XMLException
XMLException
public final BooleanField addBooleanField(String var, Boolean value) throws XMLException
var
- name of fieldvalue
- value of fieldXMLException
public void addFORM_TYPE(String value) throws XMLException
value
- value of fieldXMLException
protected void addField(AbstractField<?> f) throws XMLException
XMLException
public final FixedField addFixedField(String value) throws XMLException
value
- value of fieldXMLException
public final FixedField addFixedField(String var, String value) throws XMLException
value
- value of fieldXMLException
public final HiddenField addHiddenField(String var, String value) throws XMLException
var
- name of fieldvalue
- value of fieldXMLException
public final JidMultiField addJidMultiField(String var, JID... value) throws XMLException
var
- name of fieldvalue
- values of fieldXMLException
public final JidSingleField addJidSingleField(String var, JID value) throws XMLException
var
- name of fieldvalue
- value of fieldXMLException
public final ListMultiField addListMultiField(String var, String... value) throws XMLException
var
- name of fieldvalue
- values of fieldXMLException
public final ListSingleField addListSingleField(String var, String value) throws XMLException
var
- name of field.value
- value of fieldXMLException
public final TextMultiField addTextMultiField(String var, String... value) throws XMLException
var
- name of fieldvalue
- values of fieldXMLException
public final TextPrivateField addTextPrivateField(String var, String value) throws XMLException
var
- name of field.value
- value of fieldTextPrivateField
XMLException
public final TextSingleField addTextSingleField(String var, String value) throws XMLException
var
- name of field.value
- value od field.XMLException
public void cleanUpForm() throws XMLException
XMLException
public Element createSubmitableElement(XDataType type) throws JaxmppException
type
- data typeJaxmppException
public String getAsString() throws XMLException
ElementWrapper
getAsString
in interface Element
getAsString
in class ElementWrapper
XMLException
public <X extends AbstractField<?>> X getField(String var)
var
- name of fieldnull
is field with given name doesn't exists in form.public <X extends AbstractField<?>> X getField(int row, String var) throws XMLException
XMLException
public ArrayList<AbstractField<?>> getFields()
public List<AbstractField<?>> getFields(boolean includeHidden)
public String getInstructions() throws XMLException
XMLException
public void setInstructions(String instructions) throws XMLException
instructions
- instruction.XMLException
public int getRowsCount() throws XMLException
XMLException
public String getTitle() throws XMLException
XMLException
public void setTitle(String title) throws XMLException
title
- titleXMLException
public XDataType getType() throws XMLException
XMLException
Copyright © 2006–2023 Tigase. All rights reserved.