return;
}
for (String linkId : links.getLinks().keySet()) {
LinkType linkType = getLinkType(linkId);
LinkInfo linkInfo = links.getLinks().get(linkId);
List<String> qualifiedName = linkInfo.getQualifiedName();
List<String> metadataProperties = null;
if (qualifiedName.size() < 2) {
errors.add(new LinkError(
linkInfo.getLine(),
"Link "
+ linkId
+ " - the qualified name has to have at least 2 elements."));
} else {
if (linkType != null) {
switch (linkType) {
case Event:
metadataProperties = validate(linkId, linkInfo, true);
if (metadataProperties == null) {
errors.add(new LinkError(
linkInfo.getLine(),
"Link "
+ linkId
+ " refers to a non-existent operation"));
} else {
validateLinkTypeWithMetadata(linkType,
metadataProperties, linkInfo, linkId);
}
break;
case Input:
case Output:
case Model:
if (!checkFirstElement(systemName, qualifiedName)) {
metadataProperties = validate(linkId, linkInfo,
true);
} else {
errors.add(new LinkError(linkInfo.getLine(),
"Link " + linkId + " should refer to a "
+ systemName + " intance variable"));
}
if (metadataProperties == null) {
errors.add(new LinkError(
linkInfo.getLine(),
"Link "
+ linkId
+ " refers to a non-existent variable"));
} else {
validateLinkTypeWithMetadata(linkType,
metadataProperties, linkInfo, linkId);
}
break;
case SDP:
metadataProperties = validate(linkId, links.getLinks()
.get(linkId), false);
if (metadataProperties == null) {
errors.add(new LinkError(linkInfo.getLine(),
"Link " + linkId
+ " refers to a non-existent value"));
} else {
validateLinkTypeWithMetadata(linkType,
metadataProperties, linkInfo, linkId);