comparison artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java @ 351:eb1136134d09

Prepare inter-facet pre-rendering communication ('blackboard') phase. artifacts/trunk@3329 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 30 Nov 2011 08:13:48 +0000
parents 93a774fe2bb4
children 1d11a0531242
comparison
equal deleted inserted replaced
350:ab743e750ac6 351:eb1136134d09
1 package de.intevation.artifactdatabase.state; 1 package de.intevation.artifactdatabase.state;
2
3 import java.util.List;
2 4
3 import org.w3c.dom.Document; 5 import org.w3c.dom.Document;
4 import org.w3c.dom.Element; 6 import org.w3c.dom.Element;
5 import org.w3c.dom.Node; 7 import org.w3c.dom.Node;
6 8
16 * 18 *
17 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
18 */ 20 */
19 public class DefaultFacet implements Facet { 21 public class DefaultFacet implements Facet {
20 22
21 /** The index of this facet.*/ 23 /** The index of this facet. */
22 protected int index; 24 protected int index;
23 25
24 /** The name of this facet.*/ 26 /** The name of this facet. */
25 protected String name; 27 protected String name;
26 28
27 /** The description of this facet.*/ 29 /** The description of this facet. */
28 protected String description; 30 protected String description;
29 31
32
33 /** Trivial, empty constructor. */
30 public DefaultFacet() { 34 public DefaultFacet() {
31 } 35 }
36
32 37
33 /** 38 /**
34 * The default constructor to create new Facet objects. 39 * The default constructor to create new Facet objects.
35 * 40 *
36 * @param name The name of this new facet. 41 * @param name The name of this new facet.
52 this.index = index; 57 this.index = index;
53 this.name = name; 58 this.name = name;
54 this.description = description; 59 this.description = description;
55 } 60 }
56 61
62
63 /**
64 * Copies name, index and description of other facet.
65 */
57 public void set(Facet other) { 66 public void set(Facet other) {
58 index = other.getIndex(); 67 index = other.getIndex();
59 name = other.getName(); 68 name = other.getName();
60 description = other.getDescription(); 69 description = other.getDescription();
61 } 70 }
71
62 72
63 public Facet deepCopy() { 73 public Facet deepCopy() {
64 DefaultFacet copy = new DefaultFacet(); 74 DefaultFacet copy = new DefaultFacet();
65 copy.set(this); 75 copy.set(this);
66 return copy; 76 return copy;
80 public String getDescription() { 90 public String getDescription() {
81 return description; 91 return description;
82 } 92 }
83 93
84 94
95 /**
96 * @return null
97 */
85 public Object getData(Artifact artifact, CallContext context) { 98 public Object getData(Artifact artifact, CallContext context) {
86 return null; 99 return null;
87 } 100 }
101
102
103 /**
104 * (Do not) provide data.
105 * Override to allow other facets to access your data.
106 * @return always null.
107 */
108 public Object provideBlackboardData(
109 Artifact artifact,
110 Object key,
111 Object param,
112 CallContext context
113 ) {
114 return null;
115 }
116
117
118 /**
119 * Return list of keys (objects) for which this facet can provide data
120 * ("external parameterization"), for other facets, via blackboard.
121 */
122 public List getDataProviderKeys() {
123 return null;
124 }
125
88 126
89 public String toString() { 127 public String toString() {
90 return new StringBuilder("name = '") 128 return new StringBuilder("name = '")
91 .append(name).append("', index = ") 129 .append(name).append("', index = ")
92 .append(index).append(", description = '") 130 .append(index).append(", description = '")

http://dive4elements.wald.intevation.org