annotate artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java @ 289:cf2e8cca02b7

Tagged RELEASE 1.3 of artifacts system. artifacts/trunk@2258 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 28 Jun 2011 07:51:17 +0000
parents 7c33cac15134
children e5bc48dc3ec3
rev   line source
226
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.artifactdatabase.state;
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
280
7fbe674d758a Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 277
diff changeset
3 import de.intevation.artifacts.Artifact;
7fbe674d758a Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 277
diff changeset
4 import de.intevation.artifacts.CallContext;
7fbe674d758a Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 277
diff changeset
5
226
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 /**
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 * The default implementation of a Facet.
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 *
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 */
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 public class DefaultFacet implements Facet {
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13
277
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
14 /** The index of this facet.*/
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
15 protected int index;
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
16
226
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 /** The name of this facet.*/
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 protected String name;
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 /** The description of this facet.*/
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 protected String description;
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 /**
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 * The default constructor to create new Facet objects.
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 *
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 * @param name The name of this new facet.
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 * @param description The description of this new facet.
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 */
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 public DefaultFacet(String name, String description) {
277
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
31 this(0, name, description);
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
32 }
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
33
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
34
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
35 /**
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
36 * The default constructor to create new Facet objects.
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
37 *
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
38 * @param index The index of this new facet.
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
39 * @param name The name of this new facet.
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
40 * @param description The description of this new facet.
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
41 */
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
42 public DefaultFacet(int index, String name, String description) {
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
43 this.index = index;
226
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 this.name = name;
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 this.description = description;
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 }
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48
277
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
49 public int getIndex() {
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
50 return index;
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
51 }
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
52
0a579b71496b Facets have indices now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 226
diff changeset
53
226
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 public String getName() {
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 return name;
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 }
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 public String getDescription() {
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 return description;
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 }
280
7fbe674d758a Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 277
diff changeset
62
7fbe674d758a Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 277
diff changeset
63
7fbe674d758a Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 277
diff changeset
64 public Object getData(Artifact artifact, CallContext context) {
7fbe674d758a Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 277
diff changeset
65 return null;
7fbe674d758a Facets got a method that return its required data from the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 277
diff changeset
66 }
283
7c33cac15134 Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 280
diff changeset
67
7c33cac15134 Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 280
diff changeset
68 public String toString() {
7c33cac15134 Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 280
diff changeset
69 return new StringBuilder("name = '")
7c33cac15134 Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 280
diff changeset
70 .append(name).append("', index = ")
7c33cac15134 Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 280
diff changeset
71 .append(index).append(", description = '")
7c33cac15134 Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 280
diff changeset
72 .append(description).append("'")
7c33cac15134 Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 280
diff changeset
73 .toString();
7c33cac15134 Added DefaultFacet.toString() method to help debugging.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 280
diff changeset
74 }
226
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 }
41404961c804 Added support for facets - facets of output modes are read from configuration now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org