package com.jxml.quick.util.qjmlExpand;
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.*;

/**
 * Extracts QJML data.
 */
public class QCField extends OCMpeerSupport
{
	/**
	 * User-provided code to perform the conversion.
	 */
	public void cvt(Object coin)
		throws SAXException, IOException
	{
		QMField dm=(QMField)dataModel;
		QMCoin enclosingCoin=(QMCoin)coin;
		Counter.SubCounter subCounter=(Counter.SubCounter)context;

		subCounter.addIDAttribute(this);
		addStringAttribute("name",dm.name);

		HashMap accessors=enclosingCoin.accessors;
		String key="field_"+dm.name;
		boolean inherited=!accessors.containsKey(key);
		addBooleanAttribute("inherited",inherited);

		addIntAttribute("size",dm.size);
		addStringAttribute("coin",dm.coin);
		addStringAttribute("key",dm.key);
		addStringAttribute("kind",dm.kind);
		addStringAttribute("initializer",dm.initializer);

		emptyElement("field");
	}
}
