package com.jxml.quick.tf;
import com.jxml.quick.*;
import com.jxml.quick.access.*;
import java.util.*;
import java.beans.*;
import java.lang.reflect.*;

public class QListTF implements QTargetFactory
{
    public Object create(QContext context)
	throws QPE
    {
	return new ArrayList();
    }

    public boolean isInstance(Object object, QContext context)
    {
	return object instanceof ArrayList;
    }

    public String getName(Object object)
    {
	return "";
    }

    public String getText(Object object, 
			  QContext context)
	throws QPE
    {
	return "";
    }

    public void add(Object object, 
		    String name, 
		    String text,
		    QAccess access,
		    Object parent,
		    QTargetFactory parentFactory,
		    QContext context)
	throws QPE
    {
	if (!isInstance(object,context))
	    context.throwPE("Class mismatch: "+object.getClass().getName());
	if (parent==null)
	    context.doc.setRoot(object);
	else
	    access.add(parent,parentFactory,object,context);
    }

    public PropertyDescriptor[] getPropertyDescriptors(QContext context)
	throws QPE
    {
	return null;
    }

    public Field[] getFields(QContext context)
	throws QPE
    {
	return null;
    }
}
