Class ValidateElement
java.lang.Object
org.jivesoftware.smackx.xdatavalidation.packet.ValidateElement
- All Implemented Interfaces:
Element
,NamedElement
,XmlElement
,XmlLangElement
,FormFieldChildElement
- Direct Known Subclasses:
ValidateElement.BasicValidateElement
,ValidateElement.OpenValidateElement
,ValidateElement.RangeValidateElement
,ValidateElement.RegexValidateElement
DataValidation Extension according to XEP-0122: Data Forms Validation. This specification defines a
backwards-compatible extension to the XMPP Data Forms protocol that enables applications to specify additional
validation guidelines related to a
FormField
in a DataForm
, such as validation of standard XML
datatypes, application-specific datatypes, value ranges, and regular expressions.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Validation only against the datatype itself.static class
This element indicates for "list-multi", that a minimum and maximum number of options should be selected and/or entered.static class
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
Indicate that the value should fall within a certain range.static class
Indicates that the value should be restricted to a regular expression. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
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, String method) Check that the field being build is not of type multi (or hidden).static ValidateElement
Specifies the data type of any value contained within theFormField
element.Returns the root element name.Get list range.Returns the root element XML namespace.getQName()
final boolean
void
setListRange
(ValidateElement.ListRange listRange) Set list range.toXML
(XmlEnvironment enclosingNamespace) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jivesoftware.smackx.xdata.FormFieldChildElement
isExclusiveElement, requiresNoTypeSet, validate
Methods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage
-
Field Details
-
DATATYPE_XS_STRING
- See Also:
-
ELEMENT
- See Also:
-
NAMESPACE
- See Also:
-
QNAME
-
-
Method Details
-
getDatatype
Specifies the data type of any value contained within theFormField
element. It MUST meet one of the following conditions:- Returns:
- the datatype
-
getElementName
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
Description copied from interface:XmlElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceXmlElement
- Returns:
- the namespace.
-
getQName
- Specified by:
getQName
in interfaceXmlElement
-
mustBeOnlyOfHisKind
- Specified by:
mustBeOnlyOfHisKind
in interfaceFormFieldChildElement
-
toXML
-
appendXML
Append XML.- Parameters:
buf
- TODO javadoc me please
-
setListRange
Set list range.- Parameters:
listRange
- the listRange to set
-
getListRange
Get list range.- Returns:
- the listRange
-
checkConsistency
Check if this element is consistent according to the business rules in XEP-0122.- Specified by:
checkConsistency
in interfaceFormFieldChildElement
- Parameters:
formFieldBuilder
- the builder used to construct the form field.
-
from
-
checkListRangeConsistency
The >list-range/< element SHOULD be included only when the <field/> is of type "list-multi" and SHOULD be ignored otherwise.- Parameters:
formField
- TODO javadoc me please
-
checkNonMultiConsistency
Check that the field being build is not of type multi (or hidden).- Parameters:
formField
- TODO javadoc me pleasemethod
- TODO javadoc me please
-