Package com.mayam.wf.config.shared
Class Cvl
java.lang.Object
com.mayam.wf.config.shared.Cvl
- All Implemented Interfaces:
Copyable
,Serializable
A Control Value List (CVL) to be associated with a
Field
,
providing a list of valid choices. The data type of each individual value is String
regardless of associated attribute. These strings MUST be convertible to the actual value
class of the attribute.
Fields of attributes having a value class corresponding to an enum has two possible types:
Cvl.Type.ENUM
with which all enum values are choices (default translations where
applicable), and the Cvl.Type.ENUM_SUBSET
which corresponds to a subset where
translation overrides are possible.
For attributes with other value classes, there are six options:
Cvl.Type.STATIC
will store a static control value list with translations within
the configuration. A type of Cvl.Type.SITE
, Cvl.Type.USER_SITE
, or Cvl.Type.MAM
together with a remote identifier will define a dynamic list with values received from site
code or MAM dictionary respectively. The Cvl.Type.MAM_USER
will fetch a mam user list
(possibly filtered by a group name) and the Cvl.Type.MAM_GROUP
will fetch a mam group
list, possibly filtered by a regExp filter
The USER_SITE
will cause the site code implementation to be provided with the name
of the user accessing the CVL. For this reason, a USER_SITE
CVL cannot be cached
server wide as is done with the SITE
and MAM
.- Author:
- Markus MÃ¥rtensson
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mayam.wf.attributes.shared.Copyable
Copyable.Utilities
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasFilteredValueList
(Predicate<String> filter) Returns a filtered ValueList representation of this Cvl, dropping i18n support.Returns a ValueList representation of this Cvl, dropping i18n support.copy()
Performs a deep copy of the object.boolean
void
fromValueList
(ValueList list, boolean keepOriginal) Converts the providedValueList
(which does not have i18n support) into Cvl entries and adds them to the Cvl, optionally keeping the original entries in place.getTextForValue
(String value) Returns the value for a given key of this CVL.getType()
int
hashCode()
Looks up a translation for a given value, returning null if none was found.void
replaceWith
(ValueList list) Replaces the current CVL contents with the contents of the providedValueList
(which does not have i18n support).void
replaceWith
(Class<?> valueClass, EnumTranslations trans) Replaces the CVL with translated enumerations.void
setDefaultValue
(String defaultValue) void
setRemoteId
(String remoteId) void
toString()
-
Constructor Details
-
Cvl
public Cvl()
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
getTextForValue
Returns the value for a given key of this CVL. Returns null if doesn't exist- Parameters:
value
-- Returns:
- TranslatedString for given key
-
asValueList
Returns a ValueList representation of this Cvl, dropping i18n support. -
asFilteredValueList
Returns a filtered ValueList representation of this Cvl, dropping i18n support.asFilteredValueList(v->v.contains("poms"))
-
getType
-
getDefaultValue
-
setDefaultValue
-
getEntries
-
getRemoteId
-
setRemoteId
-
lookup
Looks up a translation for a given value, returning null if none was found. -
copy
Description copied from interface:Copyable
Performs a deep copy of the object.
-