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

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

    protected Object get(Object parent, QContext context)
	throws QPE
    {
	validateParent(parent,context);
	QIML ef=(QIML)parent;
	return ef.SYSTEM;
    }

    protected void validateChild(Object child, QContext context)
	throws QPE
    {
	if (!(child instanceof String))
	    context.throwPE("requires String child, not"+
			    child.getClass());
    }

    public void add(Object parent, 
		    QTargetFactory parentFactory,
		    Object child, 
		    QContext context)
	throws QPE
    {
	validateParent(parent,context);
	validateChild(child,context);
	QIML ef=(QIML)parent;
	ef.SYSTEM=(String)child;
    }
}
