Package com.im.df.api.util
Interface ExtraDFItemProperty<T extends DFItem,S>
-
- Type Parameters:
T
- type of property (DFEntity, DFField, etc.)S
- expected type of property value
public interface ExtraDFItemProperty<T extends DFItem,S>
Allows to edit Extra attributes for items in schema editor.- Author:
- pzajac
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ExtraDFItemProperty.Customizer<S>
Customizer for property value modification.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
applyChange(java.lang.String oldValue, java.lang.String newValue, com.im.commons.progress.DFEnvironmentRW env)
Applies change based on old and new value.ExtraDFItemProperty.Customizer<S>
createCustomizer(T item, S value)
Create a customizer for property value modification.java.lang.String
getDisplayName()
java.lang.String
getDisplayValue(S value)
Creates value from S which can be presented to the user.java.lang.String
getPropertyName()
Return the code name of the property.java.lang.String
getShortDescription()
boolean
isCompatible(DFItem item)
Check if this property can be applied to the input item.S
parse(T item, java.lang.String value)
Parses string value of property and returns instance of desired typeS
.java.lang.String
serialize(S value)
Opposite of parse.
-
-
-
Method Detail
-
isCompatible
boolean isCompatible(DFItem item)
Check if this property can be applied to the input item.- Parameters:
item
- The item for testing- Returns:
- True if property can be applied
-
getPropertyName
java.lang.String getPropertyName()
Return the code name of the property.- Returns:
- The xattribute unique property name
-
getDisplayName
java.lang.String getDisplayName()
- Returns:
- display name of the property
-
getShortDescription
java.lang.String getShortDescription()
- Returns:
- Short description - tooltip.
-
createCustomizer
ExtraDFItemProperty.Customizer<S> createCustomizer(T item, S value)
Create a customizer for property value modification.- Parameters:
item
- item for customization.value
- default value.- Returns:
- The customizer.
-
parse
S parse(T item, java.lang.String value)
Parses string value of property and returns instance of desired typeS
.ExtraDFItemProperties.getExtraPropertyValue(com.im.df.api.ddl.DFItem, java.lang.Class)
utility method makes use of this- Parameters:
item
- DFItem of type T for which we determine the property value.value
- string representation of property value- Returns:
- instance of property value of type
S
- Since:
- 6.0
-
serialize
java.lang.String serialize(S value)
Opposite of parse. Gets the property value and returns the value which can be persisted.- Parameters:
value
- the property value- Returns:
- serialized representation which can be fed to
parse(T, java.lang.String)
-
getDisplayValue
java.lang.String getDisplayValue(S value)
Creates value from S which can be presented to the user.- Parameters:
value
- the property value- Returns:
- human-readable representation of value
-
applyChange
void applyChange(java.lang.String oldValue, java.lang.String newValue, com.im.commons.progress.DFEnvironmentRW env)
Applies change based on old and new value.- Parameters:
oldValue
- old valuenewValue
- new valueenv
- environment- Since:
- 17.3.27
-
-