public interface MinMaxLengthElement
Element.buildAttribute(org.symphonyoss.symphony.messageml.MessageMLParser, org.w3c.dom.Node)
without calling super, it is needed to manage manually MINLENGTH_ATTR, MAXLENGTH_ATTR attributes| Modifier and Type | Field and Description |
|---|---|
static List<String> |
ALL_MIN_MAX_ATTRS |
static String |
MAXLENGTH_ATTR |
static String |
MINLENGTH_ATTR |
| Modifier and Type | Method and Description |
|---|---|
default Integer |
getAttributeAsInteger(String attributeName)
This method take the value corresponding to the attribute given as input and convert
it to an Integer, if possible
|
String |
getAttributeValue(String attributeName) |
default Integer |
getDefaultValueIfCurrentIsNull(Integer currentValue,
Integer defaultValue)
In case these is no maxlenght or no minlength this method return the default value assigned
to each attributes
|
String |
getElementInitialValue() |
String |
getElementType() |
default String |
getLengthErrorMessage(String attributeName) |
Integer |
getMaxValueAllowed() |
Integer |
getMinValueAllowed() |
boolean |
hasElementInitialValue() |
default boolean |
isLengthOutOfRange(Integer length)
Check if the length of the input is in the default ranges of the element
|
default boolean |
isMinAndMaxLengthCombinationValid(Integer minLength,
Integer maxLength)
Checks if the [minlength, maxlength] range is valid
|
default boolean |
isTextBiggerThanMaxLength(Integer maxLength,
String text) |
default boolean |
isTextSmallerThanMinLength(Integer minLength,
String text) |
default void |
validateInitialValueIfFound(Integer minLength,
Integer maxLength)
This method validates in case there is an initial value in the element, if that input is a
valid one, meaning that it respects the range of minlength and maxlength.
|
default void |
validateMinAndMaxLengths()
This method checks if the values assigned to minlength and maxlength attributes
are valid.
|
static final String MINLENGTH_ATTR
static final String MAXLENGTH_ATTR
default void validateMinAndMaxLengths()
throws InvalidInputException
InvalidInputException - when the attributes value are not valid or the input is not in rangedefault void validateInitialValueIfFound(Integer minLength, Integer maxLength) throws InvalidInputException
minLength - valuemaxLength - valueInvalidInputException - if the the initial value is not in rangedefault Integer getDefaultValueIfCurrentIsNull(Integer currentValue, Integer defaultValue)
currentValue - is attribute as a value assigneddefaultValue - default value for that attributedefault boolean isMinAndMaxLengthCombinationValid(Integer minLength, Integer maxLength)
maxLength - valueminLength - valuedefault boolean isTextBiggerThanMaxLength(Integer maxLength, String text)
maxLength - valuetext - given in inputdefault boolean isTextSmallerThanMinLength(Integer minLength, String text)
minLength - valuetext - given in inputdefault Integer getAttributeAsInteger(String attributeName) throws InvalidInputException
attributeName - attribute to be convertedInvalidInputException - if the value of the attribute is not a numeric onedefault boolean isLengthOutOfRange(Integer length)
length - of the inputString getElementType()
boolean hasElementInitialValue()
String getElementInitialValue()
String getAttributeValue(String attributeName)
attributeName - we want to retrieveInteger getMinValueAllowed()
Integer getMaxValueAllowed()
Copyright © 2020 The Symphony Software Foundation. All rights reserved.