private IList <string> GetMapping(BeanProperty property) { Hl7XmlMappingAttribute annotation = property.GetAnnotation <Hl7XmlMappingAttribute>(); if (annotation != null) { return(Arrays.AsList(annotation.Value)); } else { return(CollUtils.EmptyList <string>()); } }
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); }
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); }
private static IList <Mapping> From(Hl7XmlMappingAttribute mapping, Hl7MapByPartTypeAttribute[] exceptions) { return(mapping == null?CollUtils.EmptyList <Mapping>() : From(Arrays.AsList(mapping.Value), exceptions)); }