示例#1
0
        private ICollection <Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNameUse> ParseNameUses(string usesString, XmlElement
                                                                                                      element, XmlToModelResult xmlToModelResult)
        {
            ICollection <Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNameUse> uses = CollUtils.SynchronizedSet(new LinkedSet <Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNameUse
                                                                                                                                    >());

            if (StringUtils.IsNotBlank(usesString))
            {
                StringTokenizer tokenizer = new StringTokenizer(usesString);
                while (tokenizer.HasMoreElements())
                {
                    string token = tokenizer.NextToken();
                    Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNameUse nameUse = CodeResolverRegistry.Lookup <Ca.Infoway.Messagebuilder.Domainvalue.Basic.EntityNameUse
                                                                                                                     >(token);
                    if (nameUse != null)
                    {
                        uses.Add(nameUse);
                    }
                    else
                    {
                        RecordError("Name use '" + token + "' not recognized.", element, xmlToModelResult);
                    }
                }
            }
            return(uses);
        }
示例#2
0
        private ICollection <Ca.Infoway.Messagebuilder.Domainvalue.PostalAddressUse> ParseAddressUses(string nameUseAttribute, XmlNode
                                                                                                      node, XmlToModelResult xmlToModelResult)
        {
            ICollection <Ca.Infoway.Messagebuilder.Domainvalue.PostalAddressUse> uses = CollUtils.SynchronizedSet(new LinkedSet <Ca.Infoway.Messagebuilder.Domainvalue.PostalAddressUse
                                                                                                                                 >());

            if (nameUseAttribute != null)
            {
                StringTokenizer tokenizer = new StringTokenizer(nameUseAttribute);
                while (tokenizer.HasMoreElements())
                {
                    string token = tokenizer.NextToken();
                    Ca.Infoway.Messagebuilder.Domainvalue.PostalAddressUse postalAddressUse = CodeResolverRegistry.Lookup <Ca.Infoway.Messagebuilder.Domainvalue.PostalAddressUse
                                                                                                                           >(token);
                    if (postalAddressUse == null)
                    {
                        // error if a use is not found
                        RecordError("PostalAddressUse '" + token + "' is not valid", (XmlElement)node, xmlToModelResult);
                    }
                    else
                    {
                        uses.Add(postalAddressUse);
                    }
                }
            }
            return(uses);
        }