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

public class QCChildElement extends OCMtemplate
{
	String newVar;
	String var=null;
	String edName;
	String d;

	public void cvt(Object param)
		throws SAXException, IOException
	{
		QIML2JAVA.SubQIML2JAVA qiml=(QIML2JAVA.SubQIML2JAVA)context;
		ChildElement dm=(ChildElement)dataModel;
		StringBuffer sb=qiml.sb;
		if (var!=null)
		{
			newVar=(String)param;
			expand("beenHere");
			return;
		}
		var=(String)param;
		expand("template");
		d=dm.getDefault_23();
		if(d!=null)
			expand("default");
		boolean fixed=dm.getFixed_24();
		if(fixed)
			expand("fixed");
		boolean optional=dm.getOptional_21();
		if(optional)
			expand("optional");
		boolean repeating=dm.getRepeating_22();
		if(repeating)
			expand("repeating");
		Access access=dm.getAccess_25();
		doCvt(access,var);
		edName=qiml.makeName();
		ElementDefinition ed=dm.getElementDefinition_26();
		doCvt(ed,edName);
		expand("ed");
	}

	public String process(String templateName, String arg)
		throws SAXException, IOException
	{
		if("newVar".equals(arg))
			return newVar;
		if("var".equals(arg))
			return var;
		if("id".equals(arg))
		{
			QIML2JAVA.SubQIML2JAVA qiml=(QIML2JAVA.SubQIML2JAVA)context;
			ChildElement dm=(ChildElement)dataModel;
			return Quick.getId(qiml.inputDoc,dm);
		}
		if("default".equals(arg))
			return d;
		if("edName".equals(arg))
			return edName;
		return "";
	}
}
