01: package org.syrup.functions;
02:
03: import org.syrup.Context;
04: import org.syrup.Data;
05: import org.syrup.Function;
06: import org.syrup.Result;
07: import org.syrup.helpers.ResultImpl;
08: import org.syrup.helpers.Utils;
09:
10: import java.util.logging.Logger;
11:
12: /**
13: * Passes the first input to the first output and the second input to the second
14: * output.
15: *
16: * @author Robbert van Dalen
17: */
18: public class Null implements Function {
19: static final String COPYRIGHT = "Copyright 2005 Robbert van Dalen."
20: + "At your option, you may copy, distribute, or make derivative works under "
21: + "the terms of The Artistic License. This License may be found at "
22: + "http://www.opensource.org/licenses/artistic-license.php. "
23: + "THERE IS NO WARRANTY; USE THIS PRODUCT AT YOUR OWN RISK.";
24:
25: private final static Logger logger = Logger
26: .getLogger("org.syrup.functions.Null");
27:
28: /**
29: */
30: public Result execute(Context context) {
31: Data out1 = null;
32: Data out2 = null;
33:
34: if (Utils.isFull(context.in_1_link())) {
35: out1 = context.in_1_link().content();
36: }
37: if (Utils.isFull(context.in_2_link())) {
38: out2 = context.in_2_link().content();
39: }
40: return new ResultImpl(context, true, true, out1, out2);
41: }
42: }
|