Class DefaultInfoExpressionGenerator

java.lang.Object
de.hybris.platform.outboundsync.job.impl.info.DefaultInfoExpressionGenerator
All Implemented Interfaces:
InfoExpressionGenerator

public class DefaultInfoExpressionGenerator extends Object implements 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 Details

    • DefaultInfoExpressionGenerator

      public DefaultInfoExpressionGenerator()
  • Method Details

    • generateInfoExpression

      public String generateInfoExpression(TypeDescriptor itemType)
      Generates an infoExpression String from the provided TypeDescriptor and item type.
      Specified by:
      generateInfoExpression in interface InfoExpressionGenerator
      Parameters:
      itemType - - item type, for which the info expression should be generated. If null, 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:
      
         {
           "key": "clothing",
           "type": "Category",
           "rootType": "Catalog"
         }
       
      If itemType is null, then the generated info expression is an empty JSON, i.e "{}".
    • setExpressionGenerators

      public void setExpressionGenerators(Map<String,ExpressionGenerator> generators)
      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 are Map.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 the gen1 and "gen2_expr" is the expression generated by the gen2.
      null generators are ignored.