Drag[en]gine Script Module DragonScript  1.23
Dragengine.Gui.SimpleTextValidator Class Reference

Simple text validator ensure maximum text length and used characters. More...

Inheritance diagram for Dragengine.Gui.SimpleTextValidator:
Dragengine.Gui.TextValidator

Classes

enum  CharacterClass
 Character classes. More...
 

Public Member Functions

CharacterClass getCharacterClass ()
 Character class to accept. More...
 
int getMaxCharCount ()
 Maximum number of characters allowed. More...
 
SimpleTextValidator new (int maxCharCount, CharacterClass characterClass)
 Create simple text validator. More...
 
bool validates (String text)
 Text is valid. More...
 

Detailed Description

Simple text validator ensure maximum text length and used characters.

Accepts string only if the length does not exceeded a maximum number and all characters in the string match a specific set of characters. A few basic character sets are provided which are often required.

Once created the text validator is immutable.

Member Function Documentation

◆ getCharacterClass()

CharacterClass Dragengine.Gui.SimpleTextValidator.getCharacterClass ( )

Character class to accept.

◆ getMaxCharCount()

int Dragengine.Gui.SimpleTextValidator.getMaxCharCount ( )

Maximum number of characters allowed.

◆ new()

SimpleTextValidator Dragengine.Gui.SimpleTextValidator.new ( int  maxCharCount,
CharacterClass  characterClass 
)

Create simple text validator.

Parameters
maxCharCountMaximum number of characters to allow.
characterClassCharacter class to allow.
Exceptions
EInvalidParammaxCharCount is less than 1.

◆ validates()

bool Dragengine.Gui.SimpleTextValidator.validates ( String  text)

Text is valid.

Implements Dragengine.Gui.TextValidator.


The documentation for this class was generated from the following file: