class SpecificationReader {

	protected void parseLink(nu.xom.Element eLink, Architecture<Resource, Link> architecture)
			throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException,
			NoSuchMethodException {
		Link link = toEdge(eLink, null);

		String type = eLink.getAttributeValue("orientation");
		EdgeType edgeType = EdgeType.UNDIRECTED;
		if (type != null) {
			edgeType = EdgeType.valueOf(type);
		}

		String srcName = eLink.getAttributeValue("source");
		Resource source = architecture.getVertex(srcName);
		if (source == null) {
			throw new IllegalArgumentException("Source of link " + link + " not found: " + srcName);
		}

		String dstName = eLink.getAttributeValue("destination");
		Resource destination = architecture.getVertex(dstName);
		if (destination == null) {
			throw new IllegalArgumentException("Destination of link " + link + " not found: " + dstName);
		}

		architecture.addEdge(link, source, destination, edgeType);
	}

}