<P> FileWritingMessageHandlerSpec(Function<Message<P>, ?> directoryFunction) { this(new FunctionExpression<Message<P>>(directoryFunction)); }
public FunctionExpression(Function<S, ?> function) { Assert.notNull(function, "'function' must not be null."); this.function = function; this.readOnlyException = new EvaluationException(getExpressionString(), "FunctionExpression is a 'read only' Expression implementation"); }
@Override public <T> T getValue(Class<T> desiredResultType) throws EvaluationException { return getValue(this.defaultContext, desiredResultType); }
<P> FileWritingMessageHandlerSpec(Function<Message<P>, ?> directoryFunction) { this(new FunctionExpression<Message<P>>(directoryFunction)); }
@Override public Object getValue(EvaluationContext context, Object rootObject) throws EvaluationException { return getValue(rootObject); }
public FunctionExpression(Function<S, ?> function) { Assert.notNull(function, "'function' must not be null."); this.function = function; this.readOnlyException = new EvaluationException(getExpressionString(), "FunctionExpression is a 'read only' Expression implementation"); }
/** * @param key the key. * @param function the function (usually a JDK8 lambda). * @param <P> the payload type. * @return the enricher spec. * @see ContentEnricher#setPropertyExpressions(Map) * @see FunctionExpression */ public <P> EnricherSpec propertyFunction(String key, Function<Message<P>, Object> function) { this.propertyExpressions.put(key, new FunctionExpression<Message<P>>(function)); return _this(); }
@Override public <T> T getValue(Object rootObject, Class<T> desiredResultType) throws EvaluationException { return getValue(this.defaultContext, rootObject, desiredResultType); }
/** * @param key the key. * @param function the function (usually a JDK8 lambda). * @param <P> the payload type. * @return the enricher spec. * @see ContentEnricher#setPropertyExpressions(Map) * @see FunctionExpression */ public <P> EnricherSpec propertyFunction(String key, Function<Message<P>, Object> function) { this.propertyExpressions.put(key, new FunctionExpression<Message<P>>(function)); return _this(); }
@Override public <T> T getValue(Class<T> desiredResultType) throws EvaluationException { return getValue(this.defaultContext, desiredResultType); }
/** * @param variable the uri template variable. * @param valueFunction the function to evaluate value for te uri template variable. * @param <P> the payload type. * @return the current Spec. * @since 1.1.1 * @see HttpRequestExecutingMessageHandler#setUriVariableExpressions(Map) */ public <P> HttpMessageHandlerSpec uriVariable(String variable, Function<Message<P>, ?> valueFunction) { return uriVariable(variable, new FunctionExpression<Message<P>>(valueFunction)); }
@Override public <T> T getValue(Object rootObject, Class<T> desiredResultType) throws EvaluationException { return getValue(this.defaultContext, rootObject, desiredResultType); }
/** * @param name the header name. * @param function the function (usually a JDK8 lambda). * @param overwrite true to overwrite the header if already present. * @param <P> the payload type. * @return the enricher spec. * @see ContentEnricher#setHeaderExpressions(Map) * @see FunctionExpression */ public <P> EnricherSpec headerFunction(String name, Function<Message<P>, Object> function, Boolean overwrite) { return headerExpression(name, new FunctionExpression<Message<P>>(function), overwrite); }
@Override public Object getValue(EvaluationContext context, Object rootObject) throws EvaluationException { return getValue(rootObject); }
/** * Configure a {@link Function} to be invoked to generate the local file name; * argument passed to the {@code apply} method is the remote file name. * @param localFilenameFunction the localFilenameFunction. * @return the spec. * @see FunctionExpression */ public S localFilename(Function<String, String> localFilenameFunction) { return localFilenameExpression(new FunctionExpression<String>(localFilenameFunction)); }
@Override public <T> T getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType) throws EvaluationException { return ExpressionUtils.convertTypedValue(context, new TypedValue(getValue(rootObject)), desiredResultType); }
/** * @param uriVariablesFunction to use. * @param <P> the payload type. * @return the current Spec. * @since 1.1.1 * @see HttpRequestExecutingMessageHandler#setUriVariablesExpression(Expression) */ public <P> HttpMessageHandlerSpec uriVariablesFunction(Function<Message<P>, Map<String, ?>> uriVariablesFunction) { return uriVariablesExpression(new FunctionExpression<Message<P>>(uriVariablesFunction)); }
@Override public Object getValue(EvaluationContext context) throws EvaluationException { return getValue(context.getRootObject().getValue()); }
/** * Configure a {@link Function} to select messages. The argument for the function * is a {@link javax.mail.internet.MimeMessage}; {@code apply} returns a boolean * result (true means select the message). * @param selectorFunction the selectorFunction. * @return the spec. * @see FunctionExpression */ public ImapIdleChannelAdapterSpec selector(Function<MimeMessage, Boolean> selectorFunction) { return selectorExpression(new FunctionExpression<MimeMessage>(selectorFunction)); }
@Override public <T> T getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType) throws EvaluationException { return ExpressionUtils.convertTypedValue(context, new TypedValue(getValue(rootObject)), desiredResultType); }