Class AspectAttribute.DVBaseHandler<T extends DataValue,V,H extends AspectAttribute<C>.DVBaseHandler<T,V,H>>
- All Implemented Interfaces:
AspectAttribute.DataValueHandler<V>
- Direct Known Subclasses:
AspectAttribute.DVAssetHandler,AspectAttribute.DVBooleanHandler,AspectAttribute.DVDateHandler,AspectAttribute.DVNumericHandler,AspectAttribute.DVPatternHandler,AspectAttribute.DVPriceHandler,AspectAttribute.DVTextHandler
- Enclosing class:
- AspectAttribute<C extends ComplexEntity>
-
Constructor Summary
ConstructorsConstructorDescriptionDVBaseHandler(AspectAttribute<C>.mc.core.domain.base.aspect.AspectAttribute.DVStrategyBase strategy) -
Method Summary
Modifier and TypeMethodDescriptionremoveDataValueSet(DataValueSet dataValueSet) SZENARIOS:same asremoveDataValueSet(DataValueSet)to keep existing APIremoveValue(DataValueTO dvTO) removeValue(T dataValue) SZENARIOS:setCreateStdValues(boolean create) Set to true if new standard values should be created for values not already existing.setDataValueSet(DataValueSet dataValueSet) SZENARIOS:SZENARIOS:setEnumValue(DataValueSet dataValueSet) same assetDataValueSet(DataValueSet)to keep existing APIsetFromString(String valueToParse) split at multValueSplitToken (for multivalue).setFromString(String valueToParse, Locale locale) shortcut for dvh(...).setLocale( locale).setFromString( valueToParse) to keep existing APIset locale for locale dependent values (state).setMultiValueAppend(boolean append) Set to true if new list of multiple values should be appended to existing list in given locale.setMultiValues(List<DataValueTO> dataValueTOs) same assetValueTOs(List)to keep existing APIsetMultiValueSplitChars(String splitChars) set the character(s) by which multiple values are separated in String.setPrio(int prio) Expert: set prio for entityToAttribute.setPrioValue(int prioValue) Expert: set prioValue for entityToAttribute.setRemoveEmptyValues(boolean removeEmptyValues) call prior to set/add value(s).setTerritory(Territory territory) set territory for territory dependent attributes (state).setTrimValues(boolean trimValues) Trim given String values.setValue(DataValueTO dataValueTO) set value throughDataValueTOdata (terminal operation).set value (terminal operation).set list of values (terminal operation).setValueTOs(List<DataValueTO> dataValueTOs) Sets list of DataValueTOs together according to settingsetMultiValueAppend(boolean).toValueDisplay(DataValueTO dvTO) create display for data contained in TOMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface mc.core.domain.base.aspect.AspectAttribute.DataValueHandler
instance
-
Constructor Details
-
DVBaseHandler
public DVBaseHandler(AspectAttribute<C>.mc.core.domain.base.aspect.AspectAttribute.DVStrategyBase strategy)
-
-
Method Details
-
setMultiValueSplitChars
set the character(s) by which multiple values are separated in String. Default is the pipe char ('|'). Call prior to set/add value(s). -
setTrimValues
Trim given String values. Default is true. Call prior to set/add value(s). -
setRemoveEmptyValues
call prior to set/add value(s). default is false. Results in removal of value(s) in given locale for this attribute. Only taken into account when using methodsetFromString(String)orsetFromString(String, Locale), ignored when editing standard values etc. of attribute.
NOTE: you must set the territory on territory dependent attributes otherwise the values of all territories will be deleted. -
setMultiValueAppend
Set to true if new list of multiple values should be appended to existing list in given locale. Default is false, i.e a new list overwrites the existing list in given locale, also removing excess number of values. call prior to set/add value(s).- Specified by:
setMultiValueAppendin interfaceAspectAttribute.DataValueHandler<T extends DataValue>
-
setCreateStdValues
Set to true if new standard values should be created for values not already existing. Default is false. Only for AV enum scenario, ignored for all others. Call prior to set/add value(s). -
setValue
set value (terminal operation). respect flags and state data set prior to this call- Specified by:
setValuein interfaceAspectAttribute.DataValueHandler<T extends DataValue>- Throws:
mc.core.system.validation.ValidationException
-
setValues
set list of values (terminal operation). respect flags and state data set prior to this call- Specified by:
setValuesin interfaceAspectAttribute.DataValueHandler<T extends DataValue>- Throws:
mc.core.system.validation.ValidationException
-
setValue
set value throughDataValueTOdata (terminal operation). respect flags and state data contained in DataValueTO or set prior to this call (DataValueTO preceeds).COMMON:
remove value if
DataValueTO.isToRemove(). assertions: not null, value matches attribute dataTypeSZENARIOS:
AV value/AV enum: set value.
DataValueTO.setEntityToAttribute(long)orDataValueTO.setDataValueSet(long)identifies existing value (mandatory for multivalue edit).PV: set preset value dependent on
DataValueTO.setValueType(ValueType). assertions: not null, value matches attribute dataType- Specified by:
setValuein interfaceAspectAttribute.DataValueHandler<T extends DataValue>- Throws:
mc.core.system.validation.ValidationException
-
setValueTOs
public H setValueTOs(List<DataValueTO> dataValueTOs) throws mc.core.system.validation.ValidationException Sets list of DataValueTOs together according to settingsetMultiValueAppend(boolean). It is assumed that dataValues are of same locale and territory and validity if given. If a value is specified to be edited by setting e2aId this is ignored. Any special settings for text pool, e.g. correction or providing test set are ignored.- Parameters:
dataValueTOs- mandatory. If empty andremoveEmptyValuesis true remove values in content locale.- Throws:
mc.core.system.validation.ValidationException- See Also:
-
#setValueTO(DataValueTO)
-
setMultiValues
public H setMultiValues(List<DataValueTO> dataValueTOs) throws mc.core.system.validation.ValidationException same assetValueTOs(List)to keep existing API- Throws:
mc.core.system.validation.ValidationException
-
setLocale
set locale for locale dependent values (state). ignored for others (they always use UNDEFINED locale) -
setTerritory
set territory for territory dependent attributes (state). ignored for others- Specified by:
setTerritoryin interfaceAspectAttribute.DataValueHandler<T extends DataValue>
-
setPrio
Expert: set prio for entityToAttribute. Only relevant when setting values for entityToAttributes, ignored for others. Only saved when calling one of the setValue-methods. WARNING: No check with prio of other entityToAttributes is done upon save. Since for multivalue attributes all e2as for same attribute should have same prio, this must be taken care of by the caller, otherwise risk of inconsistent data. -
setPrioValue
Expert: set prioValue for entityToAttribute. Only relevant when setting values for entityToAttributes, ignored for others. Only saved when calling one of the setValue-methods. PrioValue starts with 1 and determines the sort order of multivalues.WARNING: No check with prio of other entityToAttributes is done upon save, risking inconsistend data if used incorrectly. -
setFromString
split at multValueSplitToken (for multivalue). if singleValue, use the first- Specified by:
setFromStringin interfaceAspectAttribute.DataValueHandler<T extends DataValue>- Throws:
mc.core.system.validation.ValidationException
-
setFromString
public H setFromString(String valueToParse, Locale locale) throws mc.core.system.validation.ValidationException shortcut for dvh(...).setLocale( locale).setFromString( valueToParse) to keep existing API- Specified by:
setFromStringin interfaceAspectAttribute.DataValueHandler<T extends DataValue>- Throws:
mc.core.system.validation.ValidationException
-
setEntityToAttribute
SZENARIOS:AV value / AV enum: defines the entityToAttribute to set/add new value (if multivalue and/or territory). assertions: entityToAttribute corresponds to existing entityToAttribute of current entity and attribute.
PV: ignored, not relevant
-
setDataValueSet
public H setDataValueSet(DataValueSet dataValueSet) throws mc.core.system.validation.ValidationException SZENARIOS:AV value: defines the dvSet to set/add new value (if multivalue and/or territory). assertions: set is persistent, dvSet of current attribute values, type is EXCLUSIVE
AV enum: set the dvSet as standard value. if multivalue, overwrite/append or currentE2A decide which e2a is used. asserts are: set is persistent, stdValue of current attribute, type is SHARED
PV: defines the dvSet to set/add new value
- Throws:
mc.core.system.validation.ValidationException
-
removeDataValueSet
SZENARIOS:AV value: remove dvSet and delete with all dataValues (optionally delete e2a). assertions: dvSet is EXCLUSIVE and set of current object and attribute
AV enum: remove SHARED dvSet from e2a (optionally delete e2a). assertions: dvSet is SHARED and set of current object and attribute
PV: delete dvSet and all values. assertions: dvSet is preset type and set of current attribute
- Parameters:
dataValueSet- mandatory
-
removeValue
SZENARIOS:AV value: delete value, remove and delete dvSet if last value (optionally delete e2a). assertions: value is value of EXCLUSIVE set, and value of current object and attribute
AV enum: remove SHARED dvSet containing value from e2a (optionally delete e2a). assertions: dvSet is SHARED and set of current object and attribute
PV: delete value, but not the dvSet. assertions: dvSet is preset type and set of current attribute
- Parameters:
dataValue- mandatory
-
removeValue
-
setEnumValue
public H setEnumValue(DataValueSet dataValueSet) throws mc.core.system.validation.ValidationException same assetDataValueSet(DataValueSet)to keep existing API- Throws:
mc.core.system.validation.ValidationException
-
removeEnumValue
same asremoveDataValueSet(DataValueSet)to keep existing API -
toValueDisplay
create display for data contained in TO
-