private void AddChoiceAnnotation(PartBridge part, Relationship relationship) { NamedAndTyped choiceOptionRelationship = null; string choiceType = relationship.Type; if (relationship.Choice) { choiceOptionRelationship = BeanBridgeChoiceRelationshipResolver.ResolveChoice(part, relationship); } else { if (relationship.TemplateRelationship) { Argument argument = this.interaction.GetArgumentByTemplateParameterName(relationship.TemplateParameterName); if (argument != null && argument.Choice) { Ca.Infoway.Messagebuilder.Xml.Predicate <Relationship> predicate = ChoiceSupport.ChoiceOptionTypePredicate(new string[] { part.GetTypeName() }); choiceOptionRelationship = argument.FindChoiceOption(predicate); choiceType = argument.Name; } } } if (choiceOptionRelationship != null) { CurrentBuffer().AddInfo("Selected option " + choiceOptionRelationship.Type + " (" + choiceOptionRelationship.Name + ") from choice " + choiceType); } }
public virtual object GetInitializedReadOnlyAssociation(NamedAndTyped relationshipName) { object @object; BeanProperty beanProperty = FindBeanProperty(relationshipName); if (beanProperty == null) { @object = null; } else { if (!beanProperty.Readable) { @object = null; } else { if (ListElementUtil.IsCollection((Type)beanProperty.PropertyType)) { //Initialized collections don't count @object = null; } else { @object = beanProperty.Get(); } } } return(@object); }
internal virtual object Get(NamedAndTyped relationship) { object result = this.relationships.SafeGet(new RelationshipMap.Key(relationship)); if (result == null) { result = this.relationships.SafeGet(new RelationshipMap.Key(relationship.Name)); } return(result); }
internal virtual object GetField(NamedAndTyped relationship) { object o = this.map.Get(relationship); if (o is BeanProperty) { return(GetMessageBeanPart().GetField(WordUtils.Uncapitalize(((BeanProperty)o).Name))); } else { throw new MarshallingException("Relationship " + relationship.Name + " of " + ToString() + " does not resolve to a bean property" ); } }
internal Key(NamedAndTyped namedAndTyped) { this.name = namedAndTyped.Name; this.type = namedAndTyped.Type; }
internal virtual object Get(NamedAndTyped namedAndTyped) { return(this.map.Get(namedAndTyped)); }
internal virtual bool IsCollapsedRelationship(NamedAndTyped relationshipName) { object o = Get(relationshipName); return(o != null && o is Ca.Infoway.Messagebuilder.Marshalling.RelationshipSorter); }
internal virtual Ca.Infoway.Messagebuilder.Marshalling.RelationshipSorter GetAsRelationshipSorter(NamedAndTyped relationship ) { return((Ca.Infoway.Messagebuilder.Marshalling.RelationshipSorter) this.map.Get(relationship)); }
public virtual bool IsPreInitializedDelegate(NamedAndTyped relationshipName) { return(GetInitializedReadOnlyAssociation(relationshipName) != null); }
public virtual Ca.Infoway.Messagebuilder.Marshalling.BeanWrapper CreateSubWrapper(NamedAndTyped relationshipName) { return(new Ca.Infoway.Messagebuilder.Marshalling.BeanWrapper(this, relationshipName.Name, (RelationshipSorter)this.sorter .Get(relationshipName))); }
public virtual bool IsAssociationMappedToSameBean(NamedAndTyped relationshipName) { object @object = this.sorter.Get(relationshipName); return(@object != null && @object is RelationshipSorter); }
private BeanProperty FindBeanProperty(NamedAndTyped relationshipName) { return((BeanProperty)this.sorter.Get(relationshipName)); }