public class Target
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_ADD_CHILD |
static java.lang.String |
ACTION_ADD_SIBLING |
static java.lang.String |
ACTION_REMOVE |
static java.lang.String |
ACTION_REPLACE |
static java.lang.String |
XPATH_PROPERTY_PATTERN |
Constructor and Description |
---|
Target() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAction() |
java.lang.String |
getProperty() |
int |
getTargetType() |
SynapsePath |
getXpath() |
void |
insert(MessageContext synContext,
java.util.ArrayList<org.apache.axiom.om.OMNode> sourceNodeList,
SynapseLog synLog) |
void |
insertJson(MessageContext synCtx,
java.lang.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,
java.lang.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,
java.lang.String jsonPath,
java.lang.String keyName,
java.lang.String newKeyName)
Renames a json key name at the specified json path with a new key name
|
void |
setAction(java.lang.String action) |
void |
setProperty(java.lang.String property) |
void |
setProperty(java.lang.String scope,
MessageContext messageContext,
java.lang.Object documentElement)
Sets the property value in appropriate message context
|
void |
setTargetType(int targetType) |
void |
setXpath(SynapsePath xpath) |
public static final java.lang.String ACTION_REMOVE
public static final java.lang.String ACTION_REPLACE
public static final java.lang.String ACTION_ADD_CHILD
public static final java.lang.String ACTION_ADD_SIBLING
public static final java.lang.String XPATH_PROPERTY_PATTERN
public void insert(MessageContext synContext, java.util.ArrayList<org.apache.axiom.om.OMNode> sourceNodeList, SynapseLog synLog) throws org.jaxen.JaxenException
org.jaxen.JaxenException
public void setProperty(java.lang.String scope, MessageContext messageContext, java.lang.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, java.lang.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 java.io.IOException, com.jayway.jsonpath.PathNotFoundException
synCtx
- message context.jsonPath
- JSON-path expression to select the removing element.java.io.IOException
com.jayway.jsonpath.PathNotFoundException
public void removeJsonFromProperty(MessageContext synCtx, java.lang.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, java.lang.String jsonPath, java.lang.String keyName, java.lang.String newKeyName) throws java.io.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 keyjava.io.IOException
- if failed to set the new json payloadpublic SynapsePath getXpath()
public java.lang.String getProperty()
public int getTargetType()
public void setXpath(SynapsePath xpath)
public void setProperty(java.lang.String property)
public void setTargetType(int targetType)
public java.lang.String getAction()
public void setAction(java.lang.String action)
Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.