Class DefaultChangeInfoParser
java.lang.Object
de.hybris.platform.outboundsync.job.impl.DefaultChangeInfoParser
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.fasterxml.jackson.databind.ObjectMapperReturns object mapper to be used for parsingParses info associated with an item change.voidsetFailOnUnknownProperty(boolean value) Specifies whether to fail parsing and to returnOptional.empty()from theparse(String)method, if the info string contains a property that is not "key", "type" or "rootType"
-
Constructor Details
-
DefaultChangeInfoParser
public DefaultChangeInfoParser()
-
-
Method Details
-
parse
Parses info associated with an item change.- Specified by:
parsein interfaceChangeInfoParser- Parameters:
info- a string calculated from theStreamConfigurationModel.getInfoExpression()- Returns:
- an optional containing the structured presentation of the parsed info; or
Optional.empty(), if the info could not be parsed, orinfoisnullor 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 returnOptional.empty()from theparse(String)method, if the info string contains a property that is not "key", "type" or "rootType"- Parameters:
value-true, if the parsing should fail;falseotherwise.
-