this.connListProperty = this.modelProperty;
}
else
{
ModelPath.PropertySegment head = (ModelPath.PropertySegment)this.originalEndpoint2Path.head();
PropertyDef prop = type.property(head.getPropertyName());
if (prop instanceof ListProperty)
{
this.endpoint1Path = new ModelPath("../" + endpt1PropStr);
this.endpoint2Path = this.originalEndpoint2Path.tail();
this.connListProperty = (ListProperty)prop;
}
else
{
throw new RuntimeException("Invaid Model Path:" + this.originalEndpoint2Path);
}
}
// initialize the connection parts
ElementList<?> list = element.property(this.modelProperty);
for( Element listEntryModelElement : list )
{
// check the type of connection: 1x1 connection versus 1xn connection
if (getConnectionType() == ConnectionType.OneToOne)
{
// The connection model element specifies a 1x1 connection
createNewConnectionPart(listEntryModelElement, null);
}
else
{
ModelPath.PropertySegment head = (ModelPath.PropertySegment)this.originalEndpoint2Path.head();
PropertyDef connProp = listEntryModelElement.property(head.getPropertyName()).definition();
if (!(connProp instanceof ListProperty))
{
throw new RuntimeException("Expecting " + connProp.name() + " to be a list property");
}
// the connection is of type 1xn
ElementList<?> connList = listEntryModelElement.property((ListProperty)connProp);
for (Element connElement : connList)
{