Package com.atlassian.jira.issue.fields
Class DefaultTextFieldCharacterLengthValidator
java.lang.Object
com.atlassian.jira.issue.fields.DefaultTextFieldCharacterLengthValidator
- All Implemented Interfaces:
TextFieldCharacterLengthValidator
public class DefaultTextFieldCharacterLengthValidator
extends Object
implements TextFieldCharacterLengthValidator
Reads the maximum character length from the application properties.
- Since:
- v5.0.3
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTextFieldCharacterLengthValidator(TextFieldLimitProvider textFieldLimitProvider) -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the maximum number of characters to be entered for a single field.booleanisTextTooLong(int length) Validate given number representing text length against the maximum number.booleanisTextTooLong(String text) Validate the length of the given string against the maximum number.
-
Constructor Details
-
DefaultTextFieldCharacterLengthValidator
-
-
Method Details
-
isTextTooLong
Description copied from interface:TextFieldCharacterLengthValidatorValidate the length of the given string against the maximum number.- Specified by:
isTextTooLongin interfaceTextFieldCharacterLengthValidator- Parameters:
text- the text to be checked; can benull- Returns:
- whether the given text is longer than the maximum number of characters;
nullis always valid
-
isTextTooLong
public boolean isTextTooLong(int length) Description copied from interface:TextFieldCharacterLengthValidatorValidate given number representing text length against the maximum number.- Specified by:
isTextTooLongin interfaceTextFieldCharacterLengthValidator- Parameters:
length- text length to be checked- Returns:
- whether the given number exceeds than the maximum number of characters;
-
getMaximumNumberOfCharacters
public long getMaximumNumberOfCharacters()Description copied from interface:TextFieldCharacterLengthValidatorReturns the maximum number of characters to be entered for a single field.- Specified by:
getMaximumNumberOfCharactersin interfaceTextFieldCharacterLengthValidator- Returns:
- the maximum number of characters to be entered for a single field.
-