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 TypeMethodDescriptionlong
Returns the maximum number of characters to be entered for a single field.boolean
isTextTooLong
(int length) Validate given number representing text length against the maximum number.boolean
isTextTooLong
(String text) Validate the length of the given string against the maximum number.
-
Constructor Details
-
DefaultTextFieldCharacterLengthValidator
-
-
Method Details
-
isTextTooLong
Description copied from interface:TextFieldCharacterLengthValidator
Validate the length of the given string against the maximum number.- Specified by:
isTextTooLong
in interfaceTextFieldCharacterLengthValidator
- Parameters:
text
- the text to be checked; can benull
- Returns:
- whether the given text is longer than the maximum number of characters;
null
is always valid
-
isTextTooLong
public boolean isTextTooLong(int length) Description copied from interface:TextFieldCharacterLengthValidator
Validate given number representing text length against the maximum number.- Specified by:
isTextTooLong
in 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:TextFieldCharacterLengthValidator
Returns the maximum number of characters to be entered for a single field.- Specified by:
getMaximumNumberOfCharacters
in interfaceTextFieldCharacterLengthValidator
- Returns:
- the maximum number of characters to be entered for a single field.
-