AbstractExternalDependency () { String type = readString(reader, "_type"); if (ExternalLibraryDependency.class.getSimpleName().equals(type)) { return new DefaultExternalLibraryDependency(); } else if (ExternalMultiLibraryDependency.class.getSimpleName().equals(type)) { return new DefaultExternalMultiLibraryDependency(); } else if (ExternalProjectDependency.class.getSimpleName().equals(type)) { return new DefaultExternalProjectDependency(); } else if (FileCollectionDependency.class.getSimpleName().equals(type)) { return new DefaultFileCollectionDependency(); } else if (UnresolvedExternalDependency.class.getSimpleName().equals(type)) { return new DefaultUnresolvedExternalDependency(); } else { throw new RuntimeException("Unsupported dependency"); } }