public abstract class ValidateElement extends Object implements ExtensionElement
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 String |
DATATYPE_XS_STRING |
static String |
ELEMENT |
static String |
NAMESPACE |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
appendXML(XmlStringBuilder buf) |
abstract void |
checkConsistency(FormField formField)
Check if this element is consistent according to the business rules in XEP=0122
|
protected void |
checkListRangeConsistency(FormField formField)
The
|
protected void |
checkNonMultiConsistency(FormField formField,
String method) |
String |
getDatatype()
Specifies the data type of any value contained within the
FormField element. |
String |
getElementName()
Returns the root element name.
|
ValidateElement.ListRange |
getListRange() |
String |
getNamespace()
Returns the root element XML namespace.
|
void |
setListRange(ValidateElement.ListRange listRange) |
XmlStringBuilder |
toXML()
Returns the XML representation of this Element.
|
public static final String DATATYPE_XS_STRING
public static final String ELEMENT
public static final String NAMESPACE
public String getDatatype()
FormField
element. It MUST meet one of the
following conditions:
public String getElementName()
NamedElement
getElementName
in interface NamedElement
public String getNamespace()
ExtensionElement
getNamespace
in interface ExtensionElement
public XmlStringBuilder toXML()
Element
protected abstract void appendXML(XmlStringBuilder buf)
buf
- public void setListRange(ValidateElement.ListRange listRange)
listRange
- the listRange to setpublic ValidateElement.ListRange getListRange()
public abstract void checkConsistency(FormField formField)
formField
- protected void checkListRangeConsistency(FormField formField)
formField
- protected void checkNonMultiConsistency(FormField formField, String method)
formField
- method
-