/** {@inheritDoc} */ @Override public Object apply(@Nullable final T context) { return embeddedObject.apply(context); }
/** * Return the custom (externally provided) object. * * @return the custom object */ @Nullable public Object getCustomObject() { return embeddedObject.getCustomObject(); }
/** * Set the custom (externally provided) object. * * @param object the custom object */ @Nullable public void setCustomObject(final Object object) { embeddedObject.setCustomObject(object); }
/** * Constructor. * * @param inClass the class we accept as input. * @param expression the expression to evaluate. */ public SpringExpressionContextLookupFunction(@Nonnull @ParameterName(name="inClass") final Class<T> inClass, @Nonnull @NotEmpty @ParameterName(name="expression") final String expression) { embeddedObject = new SpringExpressionFunction<>(expression); embeddedObject.setInputType(Constraint.isNotNull(inClass, "Supplied inputClass cannot be null")); if(!BaseContext.class.isAssignableFrom(inClass)) { LoggerFactory.getLogger(SpringExpressionContextLookupFunction.class). warn("InClass {} is not derived from {}", inClass, BaseContext.class); } }
/** * Set whether to hide exceptions in expression execution (default is false). * * @param flag flag to set */ public void setHideExceptions(final boolean flag) { embeddedObject.setHideExceptions(flag); }
/** * Constructor. * * @param inClass the class we accept as input. * @param expression the expression to evaluate. * @param outputType the type to test against. */ public SpringExpressionContextLookupFunction(@Nonnull @ParameterName(name="inClass") final Class<T> inClass, @Nonnull @NotEmpty @ParameterName(name="expression") final String expression, @ParameterName(name="outputType") @Nullable final Class outputType) { this(inClass, expression); embeddedObject.setOutputType(outputType); }