]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.graph.db/src/org/simantics/graph/db/MissingDependencyException.java
Change L0.Value => L0.Property to fix variable exceptions
[simantics/platform.git] / bundles / org.simantics.graph.db / src / org / simantics / graph / db / MissingDependencyException.java
1 package org.simantics.graph.db;
2
3 import java.util.Set;
4
5 import org.simantics.db.exception.DatabaseException;
6
7 public class MissingDependencyException extends DatabaseException {
8
9         private static final long serialVersionUID = -1579450497603555931L;
10         
11         private final Set<String> missingExternals;
12         
13         public MissingDependencyException(Set<String> missingExternals) {
14                 super(createMessage(missingExternals));
15                 this.missingExternals = missingExternals;
16         }
17
18         public MissingDependencyException(TransferableGraphImportProcess process) {
19                 this(process.missingExternals);
20         }
21
22         public MissingDependencyException(StreamingTransferableGraphImportProcess process) {
23                 this(process.missingExternals);
24         }
25
26         private static String createMessage(Set<String> missingExternals) {
27                 StringBuilder b = new StringBuilder();
28                 b.append("The following required items were missing from the database:\r\n");
29                 for(String missing : missingExternals) {
30                         b.append(" -" + missing + "\r\n");
31                 }
32                 return b.toString();
33         }
34         
35         public Set<String> getMissingURIs() {
36                 return missingExternals;
37         }
38         
39         @Override
40         public String getShortExplanation() {
41                 return "Missing dependencies";
42         }
43
44 }