package com.cidat.proclets;

public class ExistsValProclet implements Proclet {
	String valNameExpr;
	Proclet ifExistsProclet;
	Proclet ifNotExistsProclet;

	public ExistsValProclet(String valNameExpr, Proclet procletIfTrue,
			Proclet procletIfFalse) {
		this.valNameExpr = valNameExpr;
		this.ifExistsProclet = procletIfTrue;
		this.ifNotExistsProclet = procletIfFalse;
	}

	public void process(ProcletServiceData sd) throws ProcletException {
		String valName = sd.evalExpr(this.valNameExpr);
		boolean exists = sd.exists(valName);

		if ((exists) && (this.ifExistsProclet != null))
			this.ifExistsProclet.process(sd);
		else if ((!exists) && (this.ifNotExistsProclet != null))
			this.ifNotExistsProclet.process(sd);
	}
}

/*
 * Location:
 * D:\svn\ejie\q53.trunk\codigo\q53\q53ItourbaskWar\WebContent\WEB-INF\
 * lib\proclets_wl81.jar Qualified Name: com.cidat.proclets.ExistsValProclet
 * JD-Core Version: 0.6.0
 */