public Object call(Context context, List args) throws FunctionCallException { if (args == null || args.size() == 0) { if (log.isDebugEnabled()) { log.debug("Property key value for lookup is not specified"); } return NULL_STRING; } int size = args.size(); if (size == 1) { // get the first argument, it can be a function returning a string as well String encodedValue = StringFunction.evaluate(args.get(0), context.getNavigator()); // use the default UTF-8 decoding. return decode(log.isDebugEnabled(), DEFAULT_CHARSET, encodedValue); } else if (size == 2) { // get the first argument, it can be a function returning a string as well String encodedValue = StringFunction.evaluate(args.get(0), context.getNavigator()); // charset is in the second argument String charset = StringFunction.evaluate(args.get(1), context.getNavigator()); return decode(log.isDebugEnabled(), charset, encodedValue); } else { if (log.isDebugEnabled()) { log.debug("base64Decode function expects only two arguments maximum, returning empty string"); } } // return empty string if the arguments are wrong return NULL_STRING; }
SynapseXPathConstants.BASE64_DECODE_FUNCTION.equals(localName)) { return new Base64DecodeFunction(); } else if (localName != null && SynapseXPathConstants.URL_ENCODE_FUNCTION.equals(localName)) {
SynapseXPathConstants.BASE64_DECODE_FUNCTION.equals(localName)) { return new Base64DecodeFunction(); } else if (localName != null && SynapseXPathConstants.URL_ENCODE_FUNCTION.equals(localName)) {
return decode(log.isDebugEnabled(), SynapseXPathConstants.DEFAULT_CHARSET, encodedValue); } else if (size == 2) { return decode(log.isDebugEnabled(), charset, encodedValue); } else if (log.isDebugEnabled()) { log.debug("base64Decode function expects only two arguments maximum, returning empty string");