Esempio n. 1
0
        /// <summary>This method generates a Java representation of an XML profile message</summary>
        /// <param name="xml">an XML representation of a profile message
        /// </param>
        public virtual void  generate(System.String xml)
        {
            try
            {
                ProfileParser  pp   = new ProfileParser(false);
                AntGenerator   an   = new AntGenerator();
                RuntimeProfile spec = pp.parse(xml);

                if (spec.getHL7Version() == null || spec.getHL7Version().Equals(""))
                {
                    throw new ConformanceException("Error: Runtime Profile does not specify HL7Version");
                }

                if (spec.Message.MsgStructID == null || spec.Message.MsgStructID.Equals(""))
                {
                    throw new ConformanceException("Error: Runtime Profile does not specify MsgStructID");
                }

                this.confMsgBuilder.buildClass(spec, this);
                an.createAnt(fg.BasePath, packageName);
            }
            catch (Genetibase.NuGenHL7.conf.NuGenProfileException e)
            {
                SupportClass.WriteStackTrace(e, Console.Error);
                System.Console.Out.WriteLine(e.InnerException);
                System.Console.Out.WriteLine("ProfileException: " + e.ToString());
            }
        }
		/// <summary>This method generates a Java representation of an XML profile message</summary>
		/// <param name="xml">an XML representation of a profile message
		/// </param>
		public virtual void  generate(System.String xml)
		{
			try
			{
				ProfileParser pp = new ProfileParser(false);
				AntGenerator an = new AntGenerator();
				RuntimeProfile spec = pp.parse(xml);
				
				if (spec.getHL7Version() == null || spec.getHL7Version().Equals(""))
					throw new ConformanceException("Error: Runtime Profile does not specify HL7Version");
				
				if (spec.Message.MsgStructID == null || spec.Message.MsgStructID.Equals(""))
					throw new ConformanceException("Error: Runtime Profile does not specify MsgStructID");
				
				this.confMsgBuilder.buildClass(spec, this);
				an.createAnt(fg.BasePath, packageName);
			}
			catch (Genetibase.NuGenHL7.conf.NuGenProfileException e)
			{
				SupportClass.WriteStackTrace(e, Console.Error);
				System.Console.Out.WriteLine(e.InnerException);
				System.Console.Out.WriteLine("ProfileException: " + e.ToString());
			}
		}