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

public class QFixedAccess extends QOptionalAccess
{
    protected void validateParent(Object parent, QContext context)
	throws QPE
    {
	if (!(parent instanceof QCElementFactory))
	    context.throwPE("requires QCElementFactory parent, not"+
			    parent.getClass());
    }

    protected Object get(Object parent, QContext context)
	throws QPE
    {
	validateParent(parent,context);
	QCElementFactory cef=(QCElementFactory)parent;
	return new Boolean(cef.fixed);
    }

    public void add(Object parent, 
		    QTargetFactory parentFactory,
		    Object child, 
		    QContext context)
	throws QPE
    {
	validateParent(parent,context);
	validateChild(child,context);
	QCElementFactory cef=(QCElementFactory)parent;
	cef.fixed=((Boolean)child).booleanValue();
    }
}
