public interface CustomFieldValueHandler
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTR_FIELD
Script attribute: the custom field being validated
|
static java.lang.String |
ATTR_OBJECT
Script attribute: the object being validated
|
static java.lang.String |
ATTR_VALUE
Script attribute: the current value being validated
|
static java.lang.String |
VALUE_SEPARATOR
Separator used when multiple values are parsed from a String
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLengthValidation(org.cyclos.impl.utils.validation.Property property,
IntegerRange length)
Adds a length range validation on the given
Property for the given IntegerRange. |
void |
addPatternValidation(org.cyclos.impl.utils.validation.Property property,
java.lang.String pattern)
Adds an input with pattern validation on the given
Property for the given pattern. |
void |
addSearchTitleParameters(org.cyclos.impl.utils.reports.ReportParameters reportParameters,
java.lang.Class<? extends CustomField<?,?,?>> customFieldType,
java.util.Collection<? extends BaseValueForSearchDTO> fieldValues)
Adds as report title parameters all custom field values for search in the given collection
|
void |
addTitleParameters(org.cyclos.impl.utils.reports.ReportParameters reportParameters,
java.lang.Class<? extends CustomField<?,?,?>> customFieldType,
java.util.Collection<? extends CustomFieldValueDTO> fieldValues)
Adds as report title parameters all custom field values in the given collection
|
void |
addValueValidation(org.cyclos.impl.utils.validation.Validator validator,
CustomField<?,?,?> field,
com.querydsl.core.types.dsl.EntityPathBase<? extends CustomFieldValue<?,?,?,?>> fv,
java.util.Map<java.lang.String,?> dynamicValueBindings)
Adds a validation on the given
Validator for the given CustomField |
void |
addValueValidation(org.cyclos.impl.utils.validation.Validator validator,
CustomField<?,?,?> field,
com.querydsl.core.types.dsl.EntityPathBase<? extends CustomFieldValue<?,?,?,?>> fv,
java.util.Map<java.lang.String,?> dynamicValueBindings,
java.lang.String valuesProperty)
Adds a validation on the given
Validator for the given CustomField, using a custom values
collection |
void |
addWordSizeValidation(org.cyclos.impl.utils.validation.Property property,
CustomField<?,?,?> field)
Adds a word size validation on the given
Property.A larger default size will be applied for TEXT and URL. |
<DTO extends CustomFieldValueDTO,CF extends CustomField<?,?,?>> |
fillCustomFieldValueDTOFromString(CF field,
DTO dto,
java.lang.String value,
FormatterImpl formatter)
Fills a custom field a
|
java.lang.Object |
getValue(CustomField<?,?,?> field,
ICustomFieldValue fieldValue)
Returns the value (as entities when possible) for the given custom field value
|
org.cyclos.impl.system.DynamicFieldValuesAccessor |
newDynamicValuesAccessor(CustomField<?,?,?> field)
Returns a
DynamicFieldValuesAccessor which can be used to generate the possible values for a given custom
field |
com.querydsl.core.types.Predicate |
queryFilter(com.querydsl.core.types.EntityPath<? extends CustomFieldValue<?,?,?,?>> valuePath,
CustomField<?,?,?> customField,
CustomFieldValueForSearchDTO valueForSearch)
Returns a predicate which represents the condition for the given custom field and value path for the given custom
field search value, or null
if no query criteria specified
|
java.lang.Object |
resolveReference(CustomField<?,?,?> customField,
java.lang.String referenceValue)
Returns the entity value corresponding to the given reference
|
<CF extends CustomField<CF,C,PV>,C extends CustomFieldPossibleValueCategory<CF,C,PV>,PV extends CustomFieldPossibleValue<CF,C,PV>,V extends CustomFieldValue<CF,C,PV,O>,O extends BaseEntity & EntityWithCustomValues<CF,C,PV,V>> |
setDefaultValues(O entity,
java.util.List<CF> fields)
Adds an empty field value for each field, and fill in the default values
|
java.util.List<BaseEntity> |
toLinkedEntityValues(CustomField<?,?,?> customField,
java.util.Collection<?> values)
Convert each of the given input value to a linked entity suited for the given custom field
|
java.util.Map<java.lang.String,java.lang.Object> |
toMap(java.lang.Class<? extends CustomField<?,?,?>> customFieldType,
java.util.List<? extends ICustomFieldValue> customValues)
Returns a Map, keyed by the custom field internal names, whose values are "server side" (example,
Date,
not DateTime,
CustomFieldPossibleValue, not CustomFieldPossibleValueVO, etc) |
static final java.lang.String ATTR_OBJECT
static final java.lang.String ATTR_FIELD
static final java.lang.String ATTR_VALUE
static final java.lang.String VALUE_SEPARATOR
<DTO extends CustomFieldValueDTO,CF extends CustomField<?,?,?>> void fillCustomFieldValueDTOFromString(CF field, DTO dto, java.lang.String value, FormatterImpl formatter) throws java.text.ParseException
java.text.ParseExceptionvoid addLengthValidation(org.cyclos.impl.utils.validation.Property property,
IntegerRange length)
Property for the given IntegerRange.
If the length parameter is null then it returns without changes.void addPatternValidation(org.cyclos.impl.utils.validation.Property property,
java.lang.String pattern)
Property for the given pattern.
If the pattern parameter is empty (or null) then it returns without changes.void addSearchTitleParameters(org.cyclos.impl.utils.reports.ReportParameters reportParameters,
java.lang.Class<? extends CustomField<?,?,?>> customFieldType,
java.util.Collection<? extends BaseValueForSearchDTO> fieldValues)
void addTitleParameters(org.cyclos.impl.utils.reports.ReportParameters reportParameters,
java.lang.Class<? extends CustomField<?,?,?>> customFieldType,
java.util.Collection<? extends CustomFieldValueDTO> fieldValues)
void addValueValidation(org.cyclos.impl.utils.validation.Validator validator,
CustomField<?,?,?> field,
com.querydsl.core.types.dsl.EntityPathBase<? extends CustomFieldValue<?,?,?,?>> fv,
java.util.Map<java.lang.String,?> dynamicValueBindings)
Validator for the given CustomFieldvoid addValueValidation(org.cyclos.impl.utils.validation.Validator validator,
CustomField<?,?,?> field,
com.querydsl.core.types.dsl.EntityPathBase<? extends CustomFieldValue<?,?,?,?>> fv,
java.util.Map<java.lang.String,?> dynamicValueBindings,
java.lang.String valuesProperty)
Validator for the given CustomField, using a custom values
collectionvoid addWordSizeValidation(org.cyclos.impl.utils.validation.Property property,
CustomField<?,?,?> field)
Property.java.lang.Object getValue(CustomField<?,?,?> field, ICustomFieldValue fieldValue)
org.cyclos.impl.system.DynamicFieldValuesAccessor newDynamicValuesAccessor(CustomField<?,?,?> field)
DynamicFieldValuesAccessor which can be used to generate the possible values for a given custom
fieldcom.querydsl.core.types.Predicate queryFilter(com.querydsl.core.types.EntityPath<? extends CustomFieldValue<?,?,?,?>> valuePath, CustomField<?,?,?> customField, CustomFieldValueForSearchDTO valueForSearch)
java.lang.Object resolveReference(CustomField<?,?,?> customField, java.lang.String referenceValue)
<CF extends CustomField<CF,C,PV>,C extends CustomFieldPossibleValueCategory<CF,C,PV>,PV extends CustomFieldPossibleValue<CF,C,PV>,V extends CustomFieldValue<CF,C,PV,O>,O extends BaseEntity & EntityWithCustomValues<CF,C,PV,V>> void setDefaultValues(O entity, java.util.List<CF> fields)
java.util.List<BaseEntity> toLinkedEntityValues(CustomField<?,?,?> customField, java.util.Collection<?> values)
java.util.Map<java.lang.String,java.lang.Object> toMap(java.lang.Class<? extends CustomField<?,?,?>> customFieldType, java.util.List<? extends ICustomFieldValue> customValues)
Date,
not DateTime,
CustomFieldPossibleValue, not CustomFieldPossibleValueVO, etc)