public class Target extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_ADD_CHILD |
static String |
ACTION_ADD_SIBLING |
static String |
ACTION_REMOVE |
static String |
ACTION_REPLACE |
static String |
XPATH_PROPERTY_PATTERN |
Constructor and Description |
---|
Target() |
Modifier and Type | Method and Description |
---|---|
String |
getAction() |
String |
getProperty() |
int |
getTargetType() |
SynapsePath |
getXpath() |
void |
insert(MessageContext synContext,
ArrayList<org.apache.axiom.om.OMNode> sourceNodeList,
SynapseLog synLog) |
void |
insertJson(MessageContext synCtx,
Object sourceJsonElement,
SynapseLog synLog)
This method will insert a provided json element to a specified target.
|
void |
removeJsonFromBody(MessageContext synCtx,
SynapsePath jsonPath)
This method will remove all the matching elements of the given jsonPath from the JSON payload in the msg
context.
|
void |
removeJsonFromProperty(MessageContext synCtx,
String property,
SynapsePath jsonPath)
This method will remove all the matching elements of the given jsonPath from the JSON payload in the property
and set the result back to the same property.
|
void |
renameKey(MessageContext synapseContext,
String jsonPath,
String keyName,
String newKeyName)
Renames a json key name at the specified json path with a new key name
|
void |
setAction(String action) |
void |
setProperty(String property) |
void |
setProperty(String scope,
MessageContext messageContext,
Object documentElement)
Sets the property value in appropriate message context
|
void |
setTargetType(int targetType) |
void |
setXpath(SynapsePath xpath) |
public static final String ACTION_REMOVE
public static final String ACTION_REPLACE
public static final String ACTION_ADD_CHILD
public static final String ACTION_ADD_SIBLING
public static final String XPATH_PROPERTY_PATTERN
public void insert(MessageContext synContext, ArrayList<org.apache.axiom.om.OMNode> sourceNodeList, SynapseLog synLog) throws org.jaxen.JaxenException
org.jaxen.JaxenException
public void setProperty(String scope, MessageContext messageContext, Object documentElement)
scope
- which property needs to setmessageContext
- messageContext used in the mediationdocumentElement
- target element which needs to set as propertypublic void insertJson(MessageContext synCtx, Object sourceJsonElement, SynapseLog synLog)
synCtx
- Current Message Context.sourceJsonElement
- Evaluated Json Element by the Source.synLog
- Default Logger for the package.public void removeJsonFromBody(MessageContext synCtx, SynapsePath jsonPath) throws IOException, com.jayway.jsonpath.PathNotFoundException
synCtx
- message context.jsonPath
- JSON-path expression to select the removing element.IOException
com.jayway.jsonpath.PathNotFoundException
public void removeJsonFromProperty(MessageContext synCtx, String property, SynapsePath jsonPath)
synCtx
- message context.property
- name of the property.jsonPath
- JSON-path expression to select the removing element.public void renameKey(MessageContext synapseContext, String jsonPath, String keyName, String newKeyName) throws IOException
synapseContext
- Current message contextjsonPath
- The path to locate the key. Should be resolved to a map or an array including map items.keyName
- Current name of the keynewKeyName
- New name of the keyIOException
- if failed to set the new json payloadpublic SynapsePath getXpath()
public String getProperty()
public int getTargetType()
public void setXpath(SynapsePath xpath)
public void setProperty(String property)
public void setTargetType(int targetType)
public String getAction()
public void setAction(String action)
Copyright © 2005–2024 Apache Software Foundation. All rights reserved.