All Downloads are FREE. Search and download functionalities are using the official Maven repository.

panda.el.opt.AbstractSingleOpt Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
package panda.el.opt;

import java.util.Queue;

import panda.el.ELContext;
import panda.el.ELException;

/**
 * Abstract Single Operand Operator
 */
public abstract class AbstractSingleOpt extends AbstractOpt {
	protected Object right;

	public void wrap(Queue operand) {
		right = operand.poll();
	}

	protected boolean isReturnNull(ELContext ec, Object rval) {
		if (rval == null) {
			if (ec.strict()) {
				throw new ELException("right object is NULL: " + right);
			}
			return true;
		}
		
		return false;
	}

}