package com.jxml.quick.tf;
import com.jxml.quick.*;
import com.jxml.quick.access.*;

public class QBooleanTF extends QStringTF
{
    public boolean isInstance(Object object, QContext context)
    {
	return object instanceof Boolean;
    }

    public Object create(String text, QContext context)
	throws QPE
    {
	if ("true".equalsIgnoreCase(text))
	    return new Boolean(true);
	if ("false".equalsIgnoreCase(text))
	    return new Boolean(false);
	context.throwPE("Invalid Boolean value: "+text);
	return null;
    }
}
