Class DefaultInfoExpressionGenerator
java.lang.Object
de.hybris.platform.outboundsync.job.impl.info.DefaultInfoExpressionGenerator
- All Implemented Interfaces:
InfoExpressionGenerator
Default implementation of the info expression generator for
OutboundSyncStreamConfigurationModels.
The generated info expression provides information about the changed item integration key, type and the
root item type in the integration object associated with the stream configuration.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateInfoExpression(TypeDescriptor itemType) Generates an infoExpression String from the providedTypeDescriptorand item type.voidsetExpressionGenerators(Map<String, ExpressionGenerator> generators) Injects expression generators to be included in the info expression generation.
-
Constructor Details
-
DefaultInfoExpressionGenerator
public DefaultInfoExpressionGenerator()
-
-
Method Details
-
generateInfoExpression
Generates an infoExpression String from the providedTypeDescriptorand item type.- Specified by:
generateInfoExpressionin interfaceInfoExpressionGenerator- Parameters:
itemType- - item type, for which the info expression should be generated. Ifnull, then default info expression for the implementation should be returned.- Returns:
- a String that contains a SpEL expression to be evaluated into a JSON string containing changed item integration key,
type, and root item type in the integration object. Here is example of a string, to which the generated expression may be
evaluated at runtime:
If{ "key": "clothing", "type": "Category", "rootType": "Catalog" }itemTypeisnull, then the generated info expression is an empty JSON, i.e"{}".
-
setExpressionGenerators
Injects expression generators to be included in the info expression generation.- Parameters:
generators- expression generators to use in the info expression generation process. Key of the map is name of the element in the info expression, and value is the generator to provide expression value for that element.
For example, if generators areMap.of("one", gen1, "two", gen2), then the info expression will be{"one": "gen1_expr", "two": "gen2_expr"}, where "gen1_expr" is the expression generated by thegen1and "gen2_expr" is the expression generated by thegen2.
nullgenerators are ignored.
-