Class ValidateElement
java.lang.Object
org.jivesoftware.smackx.xdatavalidation.packet.ValidateElement
- All Implemented Interfaces:
org.jivesoftware.smack.packet.Element,org.jivesoftware.smack.packet.NamedElement,org.jivesoftware.smack.packet.XmlElement,org.jivesoftware.smack.packet.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 voidappendXML(org.jivesoftware.smack.util.XmlStringBuilder buf) Append 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.Get list range.getQName()final booleanvoidsetListRange(ValidateElement.ListRange listRange) Set list range.org.jivesoftware.smack.util.XmlStringBuildertoXML(org.jivesoftware.smack.packet.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.smack.packet.Element
toXML, toXMLMethods 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
- Specified by:
getElementNamein interfaceorg.jivesoftware.smack.packet.NamedElement
-
getNamespace
- Specified by:
getNamespacein interfaceorg.jivesoftware.smack.packet.XmlElement
-
getQName
- Specified by:
getQNamein interfaceorg.jivesoftware.smack.packet.XmlElement
-
mustBeOnlyOfHisKind
public final boolean mustBeOnlyOfHisKind()- Specified by:
mustBeOnlyOfHisKindin interfaceFormFieldChildElement
-
toXML
public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) - Specified by:
toXMLin interfaceorg.jivesoftware.smack.packet.Element
-
appendXML
protected abstract void appendXML(org.jivesoftware.smack.util.XmlStringBuilder buf) 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
-