/** * Get the value for the named output to this function. * * @param <T> the desired type of the value * @param name the name of the output parameter * @param type the expected type of the value used to convert the actual value using the * @param context the execution context to be used for converting the value; may not be null * @return the (possibly null) value for the named output, or null if there is no such named parameter * @throws ValueFormatException if the conversion from to the expected value could not be performed */ public <T> T output( String name, Class<T> type, ExecutionContext context ) { return convert(name, type, null, this.outputs, context); }
/** * Get the value for the named input to this function. The actual value will be converted to the specified type using the * {@link ExecutionContext}'s {@link ValueFactories}. * * @param <T> the desired type of the value * @param name the name of the input parameter * @param type the expected type of the value * @param defaultValue the default value to use, if the input doesn't have the named parameter * @param context the execution context to be used for converting the value; may not be null * @return the (possibly null) value for the named input, or the specified default value if there is no such named parameter * @throws ValueFormatException if the conversion from to the expected value could not be performed */ public <T> T input( String name, PropertyType type, T defaultValue, ExecutionContext context ) { return convert(name, type, defaultValue, this.inputs, context); }
/** * Get the value for the named output to this function. * * @param <T> the desired type of the value * @param name the name of the output parameter * @param type the expected type of the value used to convert the actual value using the * @param defaultValue the default value for the output parameter, if there is no such named parameter * @param context the execution context to be used for converting the value; may not be null * @return the (possibly null) value for the named output, or the specified default if there is no such named parameter * @throws ValueFormatException if the conversion from to the expected value could not be performed */ public <T> T output( String name, Class<T> type, T defaultValue, ExecutionContext context ) { return convert(name, type, defaultValue, this.outputs, context); }
/** * Get the value for the named input to this function. If the actual value corresponds to a {@link PropertyType}, then the * value will be converted to the specified type using the {@link ExecutionContext}'s {@link ValueFactories}. Otherwise, the * value will simply be cast to the supplied type. * * @param <T> the desired type of the value * @param name the name of the input parameter * @param type the expected type of the value * @param defaultValue the default value to use, if the input doesn't have the named parameter * @param context the execution context to be used for converting the value; may not be null * @return the (possibly null) value for the named input, or the specified default value if there is no such named parameter * @throws ValueFormatException if the conversion from to the expected value could not be performed */ public <T> T input( String name, Class<T> type, T defaultValue, ExecutionContext context ) { return convert(name, type, defaultValue, this.inputs, context); }
/** * Get the value for the named output to this function. The actual value will be converted to the specified type using the * {@link ExecutionContext}'s {@link ValueFactories}. * <p> * This is a convenience method, as the value would have already been set by the same function invocation using * {@link #setOutput(String, Serializable)}. * </p> * * @param <T> the desired type of the value * @param name the name of the output parameter * @param type the expected type of the value * @param defaultValue the default value for the output parameter, if there is no such named parameter * @param context the execution context to be used for converting the value; may not be null * @return the (possibly null) value for the named output, or null if there is no such named parameter * @throws ValueFormatException if the conversion from to the expected value could not be performed */ public <T> T output( String name, PropertyType type, T defaultValue, ExecutionContext context ) { return convert(name, type, defaultValue, this.outputs, context); }