Class PropertyTypeString
java.lang.Object
com.pnfsoftware.jeb.core.properties.impl.PropertyTypeString
- All Implemented Interfaces:
IPropertyType,IPropertyTypeString
String property type with optional length constraints.
-
Method Summary
Modifier and TypeMethodDescriptionafterRead(IPropertyDefinition def, Object value) Post-processing to be done after reading a value.beforeWrite(IPropertyDefinition def, Object value) Pre-processing to be done before storing a value.static PropertyTypeStringcreate()Define a string property that defaults to the empty string.static PropertyTypeStringCreate a string property type.static PropertyTypeStringCreate a string property type without explicit length constraints.booleanGet the default value.intGet the maximum allowed string length.intGet the minimum allowed string length.getName()Get the type name.inthashCode()toString()booleanValidate a property value.
-
Method Details
-
create
Create a string property type.- Parameters:
min- minimum allowed lengthmax- maximum allowed lengthdef- default value- Returns:
- a cached property type instance
-
create
Create a string property type without explicit length constraints.- Parameters:
s- default value- Returns:
- a cached property type instance
-
create
Define a string property that defaults to the empty string.- Returns:
- the property type
-
getName
Description copied from interface:IPropertyTypeGet the type name.- Specified by:
getNamein interfaceIPropertyType- Returns:
- the human-readable type name
-
getMinLength
public int getMinLength()Description copied from interface:IPropertyTypeStringGet the minimum allowed string length.- Specified by:
getMinLengthin interfaceIPropertyTypeString- Returns:
- the minimum length
-
getMaxLength
public int getMaxLength()Description copied from interface:IPropertyTypeStringGet the maximum allowed string length.- Specified by:
getMaxLengthin interfaceIPropertyTypeString- Returns:
- the maximum length
-
getDefault
Description copied from interface:IPropertyTypeGet the default value.- Specified by:
getDefaultin interfaceIPropertyType- Specified by:
getDefaultin interfaceIPropertyTypeString- Returns:
- the default value, cannot be null
-
validate
Description copied from interface:IPropertyTypeValidate a property value.- Specified by:
validatein interfaceIPropertyType- Parameters:
value- the property value- Returns:
- true on success
-
afterRead
Description copied from interface:IPropertyTypePost-processing to be done after reading a value. This method should only be called after a successful call toIPropertyType.validate(Object).- Specified by:
afterReadin interfaceIPropertyType- Parameters:
def- property definition associated with the valuevalue- must not be null- Returns:
- the converted value to expose to clients
-
beforeWrite
Description copied from interface:IPropertyTypePre-processing to be done before storing a value.- Specified by:
beforeWritein interfaceIPropertyType- Parameters:
def- property definition associated with the valuevalue- value to be stored- Returns:
- the converted value to persist
-
hashCode
public int hashCode() -
equals
-
toString
-