Class AbstractRuleElementType
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.model.type.AbstractModelItemType
org.ametys.core.model.type.AbstractElementType<Rule>
org.ametys.plugins.forms.repository.type.AbstractRuleElementType
- All Implemented Interfaces:
ElementType<Rule>
,ModelItemType
,LogEnabled
,PluginAware
,Component
,Serviceable
- Direct Known Subclasses:
RuleRepositoryElementType
Abstract class for rule element types
-
Field Summary
Fields inherited from class org.ametys.core.model.type.AbstractElementType
_jsonUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Rule
_string2Rule
(String value) Map json to ruleconvertValue
(Object value) Try to convert the given value, that is not of the managed typefromJSONForClient
(Object json, DataContext context) Convert the given client side JSON object to the types valueboolean
isCompatible
(Object value) Checks if the value is compatible with the element typeboolean
isSimple()
Determines if this type is simple or not.Cast a typed value to a StringMethods inherited from class org.ametys.core.model.type.AbstractElementType
_compareMultipleValues, _compareSingleValues, _getValueAttributes, _isMultiple, _isSingle, _isValueFromXMLMultiple, _singleValueFromXML, _singleValueToJSON, _singleValueToJSONForEdition, _singleValueToSAX, _useJSONForEdition, _valueToJSON, _valueToSAX, _valueToSAX, _valueToSAXForEdition, castValue, compareValues, getManagedClass, getManagedClassArray, parseConfiguration, service, valueFromXML, valueToJSONForClient, valueToJSONForEdition, valueToSAX, valueToSAXForEdition
Methods inherited from class org.ametys.core.model.type.AbstractModelItemType
getId, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.runtime.model.type.ModelItemType
getId, valueToJSONForClient, valueToSAX
Methods inherited from interface org.ametys.runtime.plugin.component.PluginAware
setPluginInfo
-
Field Details
-
RULE_REPOSITORY_DATA_TYPE
Constant for type rule- See Also:
-
-
Constructor Details
-
AbstractRuleElementType
public AbstractRuleElementType()
-
-
Method Details
-
convertValue
Description copied from class:AbstractElementType
Try to convert the given value, that is not of the managed type- Overrides:
convertValue
in classAbstractElementType<Rule>
- Parameters:
value
- the value to convert- Returns:
- the converted value or null if it's not possible.
-
toString
Description copied from interface:ElementType
Cast a typed value to a String- Specified by:
toString
in interfaceElementType<Rule>
- Overrides:
toString
in classAbstractElementType<Rule>
- Parameters:
value
- the value to cast- Returns:
- the String representation of the value
-
fromJSONForClient
Description copied from interface:ElementType
Convert the given client side JSON object to the types value- Parameters:
json
- the JSON object to convertcontext
- the context of the data to retrieve- Returns:
- the typed value corresponding to the JSON object
-
isSimple
Description copied from interface:ElementType
Determines if this type is simple or not. A simple element type is a type of elements that can be edited in a grid- Returns:
true
if the type is simple,false
otherwise
-
isCompatible
Description copied from interface:ElementType
Checks if the value is compatible with the element type- Specified by:
isCompatible
in interfaceElementType<Rule>
- Overrides:
isCompatible
in classAbstractElementType<Rule>
- Parameters:
value
- the value to check- Returns:
true
if the value matches the current type,false
otherwise
-
_string2Rule
Map json to rule- Parameters:
value
- the json value- Returns:
- the rule
-