public class

DefaultTextFieldCharacterLengthValidator

extends Object
implements TextFieldCharacterLengthValidator
java.lang.Object
   ↳ com.atlassian.jira.issue.fields.DefaultTextFieldCharacterLengthValidator

Class Overview

Reads the maximum character length from the application properties.

Summary

Public Constructors
DefaultTextFieldCharacterLengthValidator(TextFieldLimitProvider textFieldLimitProvider)
Public Methods
long getMaximumNumberOfCharacters()
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.fields.TextFieldCharacterLengthValidator

Public Constructors

public DefaultTextFieldCharacterLengthValidator (TextFieldLimitProvider textFieldLimitProvider)

Public Methods

public long getMaximumNumberOfCharacters ()

Returns the maximum number of characters to be entered for a single field.

Returns
  • the maximum number of characters to be entered for a single field.

public boolean isTextTooLong (int length)

Validate given number representing text length against the maximum number.

Parameters
length text length to be checked
Returns
  • whether the given number exceeds than the maximum number of characters;

public boolean isTextTooLong (String text)

Validate the length of the given string against the maximum number.

Parameters
text the text to be checked; can be null
Returns
  • whether the given text is longer than the maximum number of characters; null is always valid