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) |
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) |
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, wait
isExclusiveElement, requiresNoTypeSet
public 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.NamedElement
public java.lang.String getNamespace()
getNamespace
in interface org.jivesoftware.smack.packet.FullyQualifiedElement
public javax.xml.namespace.QName getQName()
getQName
in interface org.jivesoftware.smack.packet.FullyQualifiedElement
public final boolean mustBeOnlyOfHisKind()
mustBeOnlyOfHisKind
in interface FormFieldChildElement
public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
toXML
in interface org.jivesoftware.smack.packet.Element
protected 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 FormFieldChildElement
formFieldBuilder
- 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