package com.jxml.quick.util.cfg2html;
import com.jxml.quick.*;
import com.jxml.quick.util.*;
import com.jxml.quick.ocm.*;
import java.util.*;
import org.xml.sax.*;
import java.io.*;
import com.jxml.quick.config.*;

public class QCnvItem extends OCMtemplate
{
	public void cvt(Object param)
		throws SAXException, IOException
	{
		NVItem dm=(NVItem)dataModel;
    		if(dm.fixed)
			 return;
		if("".equals(dm.value))
			expand("nvitem");
		else
			expand("fixednvitem");
	}

	public String process(String templateName, String arg)
		throws SAXException, IOException
	{
		StringBuffer sb=context.getStringBuffer();
		NVItem dm=(NVItem)dataModel;

		if ("name".equals(arg))
		{
			return dm.name;
		}
		if ("fieldLength".equals(arg))
		{
			return dm.fieldLength;
		}

		return dm.value;
	}
}