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 QCIdentity extends OCMpeerSupport
{
	/**
	 * User-provided code to perform the conversion.
	 */
	public void cvt(Object param)
		throws SAXException, IOException
	{
		QMIdentity dm=(QMIdentity)dataModel;

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

		startElement("accessClass");

		if ("".equals(dm.kind))
			addStringContent("com.jxml.quick.access.QMALAccess");
		else if ("list".equals(dm.kind))
			addStringContent("com.jxml.quick.access.QListAccess");
		else if ("map".equals(dm.kind))
			addStringContent("com.jxml.quick.qmap.QMapAccess");
		else
			throw new SAXException("identity does not support kind: "+dm.kind);

		endElement("accessClass");
	}
}
