package com.jxml.quick.util.qjml2html;
import com.jxml.quick.model.qjml.*;
import com.jxml.quick.*;
import org.xml.sax.*;
import java.util.*;
import com.jxml.quick.ocm.*;
import java.io.*;

public class QCText  extends QCCoin
{
	public QMText ed;
	public StringBuffer sb;
	public ArrayList remList;

	public void cvt(Object param) 
		throws SAXException, IOException 
	{
		OCMcontextSupport.SubContextSupport scs=(OCMcontextSupport.SubContextSupport)context;
		sb=scs.sb;
		ed=(QMText)dataModel;
		if (param==null)
			super.cvt(ed);

		else
		{
		remList=ed.remList;
		int s=remList.size();
		for(int i=0;i<s;i++)
			{
			sb.append(((QMRem)remList.get(i)).getQText());
			}		

		}

       	}

	public String process(String templateName, String arg)
		throws SAXException, IOException
	{
	
		if("elementName".equals(arg))
		{
			return ed.tag;
		}	

		if("className".equals(arg))
		{

			return targetClassName;
		}

		if("comment".equals(arg))
		{
			remList=ed.remList;
			for(int i=0;i<remList.size();i++)
			{
				sb.append(((QMRem)remList.get(i)).getQText());	
				sb.append("\n ");
			}

		}
		return	super.process(templateName,arg);
	}

}




