public abstract class ValidateElement extends java.lang.Object implements FormFieldChildElement
FormField in a DataForm, such as validation of standard XML
datatypes, application-specific datatypes, value ranges, and regular expressions.| Modifier and Type | Class and Description |
|---|---|
static class |
ValidateElement.BasicValidateElement
Validation only against the datatype itself.
|
static class |
ValidateElement.ListRange
This element indicates for "list-multi", that a minimum and maximum number of options should be selected and/or
entered.
|
static class |
ValidateElement.OpenValidateElement
For "list-single" or "list-multi", indicates that the user may enter a custom value (matching the datatype
constraints) or choose from the predefined values.
|
static class |
ValidateElement.RangeValidateElement
Indicate that the value should fall within a certain range.
|
static class |
ValidateElement.RegexValidateElement
Indicates that the value should be restricted to a regular expression.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DATATYPE_XS_STRING |
static java.lang.String |
ELEMENT |
static java.lang.String |
NAMESPACE |
static javax.xml.namespace.QName |
QNAME |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
appendXML(org.jivesoftware.smack.util.XmlStringBuilder buf)
Append XML.
|
abstract void |
checkConsistency(FormField.Builder<?,?> formFieldBuilder)
Check if this element is consistent according to the business rules in XEP-0122.
|
protected void |
checkListRangeConsistency(FormField.Builder<?,?> formField)
The >list-range/< element SHOULD be included only when the <field/> is of type "list-multi" and SHOULD be ignored
otherwise.
|
protected void |
checkNonMultiConsistency(FormField.Builder<?,?> formField,
java.lang.String method)
Check that the field being build is not of type multi (or hidden).
|
static ValidateElement |
from(FormField formField) |
java.lang.String |
getDatatype()
Specifies the data type of any value contained within the
FormField element. |
java.lang.String |
getElementName() |
ValidateElement.ListRange |
getListRange()
Get list range.
|
java.lang.String |
getNamespace() |
javax.xml.namespace.QName |
getQName() |
boolean |
mustBeOnlyOfHisKind() |
void |
setListRange(ValidateElement.ListRange listRange)
Set list range.
|
org.jivesoftware.smack.util.XmlStringBuilder |
toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisExclusiveElement, requiresNoTypeSet, validatepublic static final java.lang.String DATATYPE_XS_STRING
public static final java.lang.String ELEMENT
public static final java.lang.String NAMESPACE
public static final javax.xml.namespace.QName QNAME
public java.lang.String getDatatype()
FormField element. It MUST meet one of the
following conditions:
public java.lang.String getElementName()
getElementName in interface org.jivesoftware.smack.packet.NamedElementpublic java.lang.String getNamespace()
getNamespace in interface org.jivesoftware.smack.packet.XmlElementpublic javax.xml.namespace.QName getQName()
getQName in interface org.jivesoftware.smack.packet.XmlElementpublic final boolean mustBeOnlyOfHisKind()
mustBeOnlyOfHisKind in interface FormFieldChildElementpublic org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
toXML in interface org.jivesoftware.smack.packet.Elementprotected abstract void appendXML(org.jivesoftware.smack.util.XmlStringBuilder buf)
buf - TODO javadoc me pleasepublic void setListRange(ValidateElement.ListRange listRange)
listRange - the listRange to setpublic ValidateElement.ListRange getListRange()
public abstract void checkConsistency(FormField.Builder<?,?> formFieldBuilder)
checkConsistency in interface FormFieldChildElementformFieldBuilder - the builder used to construct the form field.public static ValidateElement from(FormField formField)
protected void checkListRangeConsistency(FormField.Builder<?,?> formField)
formField - TODO javadoc me pleaseprotected void checkNonMultiConsistency(FormField.Builder<?,?> formField, java.lang.String method)
formField - TODO javadoc me pleasemethod - TODO javadoc me please