Ejemplo n.º 1
0
        private IList <string> GetMapping(BeanProperty property)
        {
            Hl7XmlMappingAttribute annotation = property.GetAnnotation <Hl7XmlMappingAttribute>();

            if (annotation != null)
            {
                return(Arrays.AsList(annotation.Value));
            }
            else
            {
                return(CollUtils.EmptyList <string>());
            }
        }
Ejemplo n.º 2
0
        public static IList <Mapping> From(BeanProperty property)
        {
            if (mappingCache.ContainsKey(property.Descriptor))
            {
                return(mappingCache.SafeGet(property.Descriptor));
            }
            // This is an expensive operation. If possible, let's try to do it only once.
            Hl7XmlMappingAttribute mapping = property.GetAnnotation <Hl7XmlMappingAttribute>();

            Hl7MapByPartTypeAttribute[] exceptions  = MappingHelper.GetAllHl7MapByPartType(property);
            IList <Mapping>             mappingList = From(mapping, exceptions);

            mappingCache[property.Descriptor] = mappingList;
            return(mappingList);
        }
Ejemplo n.º 3
0
        private Relationship GetCollapsedRelationship(Hl7Source source, Hl7XmlMappingAttribute mapping)
        {
            Relationship relationship = null;

            if (mapping != null)
            {
                foreach (string path in mapping.Value)
                {
                    relationship = source.GetRelationship(System.Text.RegularExpressions.Regex.Replace(path, this.contextName + ".", string.Empty
                                                                                                       ));
                    if (relationship != null)
                    {
                        break;
                    }
                }
            }
            return(relationship);
        }
Ejemplo n.º 4
0
 private static IList <Mapping> From(Hl7XmlMappingAttribute mapping, Hl7MapByPartTypeAttribute[] exceptions)
 {
     return(mapping == null?CollUtils.EmptyList <Mapping>() : From(Arrays.AsList(mapping.Value), exceptions));
 }