Package com.znize.platform.model.report
Class PeriodConverter<T extends PersistenceEntity>
- java.lang.Object
-
- com.znize.platform.model.report.PeriodConverter<T>
-
- Type Parameters:
T- entity type, a subclass of PersistenceEntity
- All Implemented Interfaces:
ValueConverter<T>,java.io.Serializable
public class PeriodConverter<T extends PersistenceEntity> extends java.lang.Object implements ValueConverter<T>, java.io.Serializable
Convert period of format "Year-periodType-periodNumber" to friendly display value for current locale.- Since:
- 4.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PeriodConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetValueAsObject(EntityProperty<T> ep, java.lang.String value)Convert string value to property type.java.lang.StringgetValueAsString(EntityProperty<T> ep, T entity)Convert property value to string.
-
-
-
Method Detail
-
getValueAsObject
public java.lang.Object getValueAsObject(EntityProperty<T> ep, java.lang.String value) throws SystemException
Description copied from interface:ValueConverterConvert string value to property type. Called before built-in data conversion.- Specified by:
getValueAsObjectin interfaceValueConverter<T extends PersistenceEntity>- Parameters:
ep- the EntityProperty whose value is to be convertedvalue- property value of String type- Returns:
- converted value
- Throws:
SystemException- throw if a data conversion error occurs
-
getValueAsString
public java.lang.String getValueAsString(EntityProperty<T> ep, T entity) throws SystemException
Description copied from interface:ValueConverterConvert property value to string. Called before built-in data conversion.- Specified by:
getValueAsStringin interfaceValueConverter<T extends PersistenceEntity>- Parameters:
ep- the EntityProperty whose value is to be convertedentity- the entity of the property- Returns:
- converted value
- Throws:
SystemException- throw if a data conversion error occurs
-
-