Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/DGMSelect.java @ 5867:59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sun, 28 Apr 2013 15:23:01 +0200 |
parents | 73da40528cf2 |
children | af13ceeba52a |
comparison
equal
deleted
inserted
replaced
5866:9a6741ccf6d4 | 5867:59ff03ff48f1 |
---|---|
20 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; | 20 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator; |
21 | 21 |
22 import org.dive4elements.river.model.DGM; | 22 import org.dive4elements.river.model.DGM; |
23 import org.dive4elements.river.model.River; | 23 import org.dive4elements.river.model.River; |
24 | 24 |
25 import org.dive4elements.river.artifacts.FLYSArtifact; | 25 import org.dive4elements.river.artifacts.D4EArtifact; |
26 import org.dive4elements.river.utils.RiverUtils; | 26 import org.dive4elements.river.utils.RiverUtils; |
27 | 27 |
28 | 28 |
29 /** | 29 /** |
30 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 30 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
45 } | 45 } |
46 | 46 |
47 | 47 |
48 @Override | 48 @Override |
49 protected Element createStaticData( | 49 protected Element createStaticData( |
50 FLYSArtifact flys, | 50 D4EArtifact flys, |
51 ElementCreator creator, | 51 ElementCreator creator, |
52 CallContext cc, | 52 CallContext cc, |
53 String name, | 53 String name, |
54 String value, | 54 String value, |
55 String type | 55 String type |
87 | 87 |
88 @Override | 88 @Override |
89 public boolean validate(Artifact artifact) | 89 public boolean validate(Artifact artifact) |
90 throws IllegalArgumentException | 90 throws IllegalArgumentException |
91 { | 91 { |
92 FLYSArtifact flys = (FLYSArtifact) artifact; | 92 D4EArtifact flys = (D4EArtifact) artifact; |
93 | 93 |
94 DGM dgm = getDGM(flys); | 94 DGM dgm = getDGM(flys); |
95 | 95 |
96 if (dgm == null) { | 96 if (dgm == null) { |
97 throw new IllegalArgumentException(ERR_INVALID_DGM); | 97 throw new IllegalArgumentException(ERR_INVALID_DGM); |
118 | 118 |
119 | 119 |
120 /** | 120 /** |
121 * Returns the DGM specified in the parameters of <i>flys</i>. | 121 * Returns the DGM specified in the parameters of <i>flys</i>. |
122 * | 122 * |
123 * @param flys The FLYSArtifact that knows the ID of a DGM. | 123 * @param flys The D4EArtifact that knows the ID of a DGM. |
124 * | 124 * |
125 * @throws IllegalArgumentException If the FLYSArtifact doesn't know the ID | 125 * @throws IllegalArgumentException If the D4EArtifact doesn't know the ID |
126 * of a DGM. | 126 * of a DGM. |
127 * | 127 * |
128 * @return the DGM specified by FLYSArtifact's parameters. | 128 * @return the DGM specified by D4EArtifact's parameters. |
129 */ | 129 */ |
130 public static DGM getDGM(FLYSArtifact flys) | 130 public static DGM getDGM(D4EArtifact flys) |
131 throws IllegalArgumentException | 131 throws IllegalArgumentException |
132 { | 132 { |
133 try { | 133 try { |
134 Integer dgmId = flys.getDataAsInteger("dgm"); | 134 Integer dgmId = flys.getDataAsInteger("dgm"); |
135 if (dgmId == null) { | 135 if (dgmId == null) { |