Class DefaultChangeInfoParser

java.lang.Object
de.hybris.platform.outboundsync.job.impl.DefaultChangeInfoParser
All Implemented Interfaces:
ChangeInfoParser

public class DefaultChangeInfoParser extends Object implements ChangeInfoParser
Implementation of the ChangeInfoParser that parses info from a JSON string of the following format: "{ "key": "..", "type": "..", "rootType": ".." }", in which order of the attributes is arbitrary and attribute "key" contains value of the changed item integration key; attribute "type" contains value of the item type; attribute "rootType" contains value of the item type that is navigated from the changed item and corresponds to the root item in the integration object used to synchronize the change.
  • Constructor Details

    • DefaultChangeInfoParser

      public DefaultChangeInfoParser()
  • Method Details

    • parse

      public Optional<ChangeInfo> parse(String info)
      Parses info associated with an item change.
      Specified by:
      parse in interface ChangeInfoParser
      Parameters:
      info - a string calculated from the StreamConfigurationModel.getInfoExpression()
      Returns:
      an optional containing the structured presentation of the parsed info; or Optional.empty(), if the info could not be parsed, or info is null or blank.
    • objectMapper

      protected com.fasterxml.jackson.databind.ObjectMapper objectMapper()
      Returns object mapper to be used for parsing
      Returns:
      an object mapper instance
    • setFailOnUnknownProperty

      public void setFailOnUnknownProperty(boolean value)
      Specifies whether to fail parsing and to return Optional.empty() from the parse(String) method, if the info string contains a property that is not "key", "type" or "rootType"
      Parameters:
      value - true, if the parsing should fail; false otherwise.