package com.jxml.quick.util.qjml2qiml;
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 QCProperty extends OCMpeerSupport
{
	/**
	 * User-provided code to perform the conversion.
	 */
	public void cvt(Object param)
		throws SAXException, IOException
	{
		QMProperty dm=(QMProperty)dataModel;

		if (dm.size!=-1)
			throw new SAXException("property does not support size: "+dm.size);
		if (dm.keyAccess!=null)
			throw new SAXException("property does not support key: "+dm.key);

		if ("".equals(dm.kind))
		{
			startElement("accessProperty");
			addStringContent(dm.name);
			endElement("accessProperty");
		}
		else if ("list".equals(dm.kind))
		{
			startElement("accessListProperty");
			addStringContent(dm.name);
			endElement("accessListProperty");
		}
		else if ("map".equals(dm.kind))
		{
			startElement("accessMapProperty");
			addStringContent(dm.name);
			endElement("accessMapProperty");
		}
		else
			throw new SAXException("property does not support kind: "+dm.kind);
	}
}
