Package org.syrup.functions

Source Code of org.syrup.functions.Null

package org.syrup.functions;

import org.syrup.Context;
import org.syrup.Data;
import org.syrup.Function;
import org.syrup.Result;
import org.syrup.helpers.ResultImpl;
import org.syrup.helpers.Utils;

import java.util.logging.Logger;

/**
* Passes the first input to the first output and the second input to the second
* output.
*
* @author Robbert van Dalen
*/
public class Null implements Function
{
    static final String COPYRIGHT = "Copyright 2005 Robbert van Dalen."
        + "At your option, you may copy, distribute, or make derivative works under "
        + "the terms of The Artistic License. This License may be found at "
        + "http://www.opensource.org/licenses/artistic-license.php. "
        + "THERE IS NO WARRANTY; USE THIS PRODUCT AT YOUR OWN RISK.";

    private final static Logger logger = Logger.getLogger("org.syrup.functions.Null");

    /**
     */
    public Result execute(Context context)
    {
        Data out1 = null;
        Data out2 = null;

        if (Utils.isFull(context.in_1_link()))
        {
            out1 = context.in_1_link().content();
        }
        if (Utils.isFull(context.in_2_link()))
        {
            out2 = context.in_2_link().content();
        }
        return new ResultImpl(context, true, true, out1, out2);
    }
}
TOP

Related Classes of org.syrup.functions.Null

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.