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
Nested ClassesModifier and TypeClassDescriptionstatic classValidation only against the datatype itself.static classThis element indicates for "list-multi", that a minimum and maximum number of options should be selected and/or entered.static classFor "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 classIndicate that the value should fall within a certain range.static classIndicates that the value should be restricted to a regular expression. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidAppend XML.abstract voidcheckConsistency(FormField.Builder<?, ?> formFieldBuilder) Check if this element is consistent according to the business rules in XEP-0122.protected voidcheckListRangeConsistency(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 voidcheckNonMultiConsistency(FormField.Builder<?, ?> formField, String method) Check that the field being build is not of type multi (or hidden).static ValidateElementSpecifies the data type of any value contained within theFormFieldelement.Returns the root element name.Get list range.Returns the root element XML namespace.getQName()final booleanvoidsetListRange(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, waitMethods inherited from interface org.jivesoftware.smackx.xdata.FormFieldChildElement
isExclusiveElement, requiresNoTypeSet, validateMethods 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 theFormFieldelement. It MUST meet one of the following conditions:- Returns:
- the datatype
-
getElementName
Description copied from interface:NamedElementReturns the root element name.- Specified by:
getElementNamein interfaceNamedElement- Returns:
- the element name.
-
getNamespace
Description copied from interface:XmlElementReturns the root element XML namespace.- Specified by:
getNamespacein interfaceXmlElement- Returns:
- the namespace.
-
getQName
- Specified by:
getQNamein interfaceXmlElement
-
mustBeOnlyOfHisKind
- Specified by:
mustBeOnlyOfHisKindin 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:
checkConsistencyin 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
-