Package org.apache.synapse.mediators
Class GetPropertyFunction
- java.lang.Object
-
- org.apache.synapse.mediators.GetPropertyFunction
-
- All Implemented Interfaces:
XPathFunction
,org.jaxen.Function
public class GetPropertyFunction extends Object implements org.jaxen.Function, XPathFunction
Implements the XPath extension function synapse:get-property(scope,prop-name)
-
-
Field Summary
Fields Modifier and Type Field Description static String
NULL_STRING
-
Constructor Summary
Constructors Constructor Description GetPropertyFunction(MessageContext synCtx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
call(org.jaxen.Context context, List args)
Returns the string value of the property which is get from the corresponding context to the provided scope .Object
evaluate(Object scopeObject, Object keyObject, Object dateformat, org.jaxen.Navigator navigator)
Returns the string value of the property using arg one as key and arg two as scopeObject
evaluate(List args)
Wraps jaxon xpath function as a javax.xml.xpath.XPathFunctionMessageContext
getSynCtx()
-
-
-
Field Detail
-
NULL_STRING
public static final String NULL_STRING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GetPropertyFunction
public GetPropertyFunction(MessageContext synCtx)
-
-
Method Detail
-
getSynCtx
public MessageContext getSynCtx()
-
call
public Object call(org.jaxen.Context context, List args) throws org.jaxen.FunctionCallException
Returns the string value of the property which is get from the corresponding context to the provided scope . The default scope is used to get property from the synapse message context- Specified by:
call
in interfaceorg.jaxen.Function
- Parameters:
context
- the context at the point in the expression when the function is calledargs
- arguments of the functions- Returns:
- The string value of a property
- Throws:
org.jaxen.FunctionCallException
-
evaluate
public Object evaluate(Object scopeObject, Object keyObject, Object dateformat, org.jaxen.Navigator navigator)
Returns the string value of the property using arg one as key and arg two as scope- Parameters:
scopeObject
- scope will decide from where property will be picked up from i.e. axis2, transport, default/synapsekeyObject
- the key of the propertynavigator
- object model which can be used for navigation arounddateformat
- The dateformat that need to convert- Returns:
- The String value of property using arg one as key and arg two as scope
-
evaluate
public Object evaluate(List args) throws XPathFunctionException
Wraps jaxon xpath function as a javax.xml.xpath.XPathFunction- Specified by:
evaluate
in interfaceXPathFunction
- Parameters:
args
- List of argument for custom xpath function- Returns:
- result of xpath evaluation
- Throws:
XPathFunctionException
-
-