Inherits from
- TraitType: enthought.traits.trait_handlers.TraitType
Attributes
Inherited from base classes
Method summary
- __getstate__(self)
- __init__(self, value = '', minlen = 0, maxlen = sys.maxint, regex = '', **metadata)
- __setstate__(self, state)
- create_editor(self)
- info(self)
- validate(self, object, name, value)
- validate_all(self, object, name, value)
- validate_len(self, object, name, value)
- validate_regex(self, object, name, value)
- validate_str(self, object, name, value)
Inherited from base classes
- arg_error(self, method, arg_num, object, name, value)
- dup_arg_error(self, method, arg_num, object, name)
- error(self, object, name, value)
- full_info(self, object, name, value)
- get_editor(self, trait = None)
- inner_traits(self)
- is_valid(self, object, name, value)
- keyword_error(self, method, object, name, value)
- missing_arg_error(self, method, arg_num, object, name)
- repr(self, value)
- return_error(self, method, object, value)
Methods
- __getstate__(self)
Returns the current state of the trait.
- __init__(self, value = '', minlen = 0, maxlen = sys.maxint, regex = '', **metadata)
Creates a String trait.
Parameters
- value : string
- The default value for the string
- minlen : integer
- The minimum length allowed for the string
- maxlen : integer
- The maximum length allowed for the string
- regex : string
- A Python regular expression that the string must match
- __setstate__(self, state)
Sets the current state of the trait.
- create_editor(self)
Returns the default traits UI editor for this type of trait.
- info(self)
Returns a description of the trait.
- validate(self, object, name, value)
Validates that the value is a valid string.
- validate_all(self, object, name, value)
Validates that the value is a valid string in the specified length range which matches the specified regular expression.
- validate_len(self, object, name, value)
Validates that the value is a valid string in the specified length range.
- validate_regex(self, object, name, value)
Validates that the value is a valid string which matches the specified regular expression.
- validate_str(self, object, name, value)
Validates that the value is a valid string.