Mercurial > dive4elements > framework
annotate artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java @ 168:f70977cf2faf
Avoid Nullpointer exception in listCollections() when no creation time of the collection is returned.
artifacts/trunk@1393 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 04 Mar 2011 09:13:18 +0000 |
parents | ece0fdb07975 |
children | 2a9591f76270 |
rev | line source |
---|---|
105
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 /* |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 * Copyright (c) 2011 by Intevation GmbH |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 * |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 package de.intevation.artifactdatabase.state; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import java.util.HashMap; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import java.util.Map; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
106
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
13 import javax.xml.xpath.XPathConstants; |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
14 |
105
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import org.w3c.dom.Document; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import org.w3c.dom.Node; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.artifacts.CallContext; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 |
106
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
20 import de.intevation.artifacts.common.utils.XMLUtils; |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
21 |
105
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.artifactdatabase.data.StateData; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 /** |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 * An abstract implementation of a {@link State}. It implements some basic |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 * methods that return the id, description and data. The methods |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 * <code>describe()</code> and <code>setup()</code> depend on the concrete class |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 * and need to be implemented by those. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 public abstract class AbstractState implements State { |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
106
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
33 /** The XPath to the ID of the state relative to the state node in the |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
34 * configuration. */ |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
35 public static final String XPATH_ID = "@id"; |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
36 |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
37 /** The XPath to the description of the state relative to the state node in |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
38 * the configuration. */ |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
39 public static final String XPATH_DESCRIPTION = "@description"; |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
40 |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
41 |
105
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 /** The ID of the state. */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 protected String id; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 /** The description of the state. */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 protected String description; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 /** The data provided by this state. */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 protected Map<String, StateData> data; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 /** |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 * The default constructor. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 * |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 * @param id The ID of the state. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 * @param description The description of the state. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 public AbstractState(String id, String description) { |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 this.id = id; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 this.description = description; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 } |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 /** |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 * Returns the ID of the state. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 * |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 * @return the ID of the state. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 public String getID() { |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 return id; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 } |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 /** |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 * Set the ID of the state. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 * |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 * @param id The ID of the state. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 public void setID(String id) { |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 this.id = id; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 } |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 /** |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 * Returns the description of the state. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 * |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 * @return the description of the state. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 public String getDescription() { |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 return description; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 } |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 /** |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 * Set the description of the state. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 * |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 * @param description The description of the state. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 public void setDescription(String description) { |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 this.description = description; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 } |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 /** |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 * Returns the data of the state. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 * |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 * @return the data of the state. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 public Map<String, StateData> getData() { |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 return data; |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 } |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 /** |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 * Add new data to the state. NOTE: If there is already an object existing |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 * with the key <i>name</i>, this object is overwritten by the new value. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 * |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 * @param name The name of the data object. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 * @param StateData The data object. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 public void addData(String name, StateData data) { |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 if (this.data == null) { |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 this.data = new HashMap<String, StateData>(); |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 } |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 this.data.put(name, data); |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 } |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 /** |
106
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
131 * Initialize the state based on the state node in the configuration. |
105
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 * |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 * @param config The state configuration node. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 */ |
106
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
135 public void setup(Node config) { |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
136 id = (String) XMLUtils.xpath(config, XPATH_ID, XPathConstants.STRING); |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
137 |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
138 description = (String) XMLUtils.xpath( |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
139 config, XPATH_DESCRIPTION, XPathConstants.STRING); |
ece0fdb07975
Implementations to initialize and retrieve states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
105
diff
changeset
|
140 } |
105
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 /** |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 * Describes the UI of the state. This method needs to be implemented by |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 * concrete subclasses. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 * |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 * @param document Describe doucment. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 * @param rootNode Parent node for all new elements. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 * @param context The CallContext. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 * @param uuid The uuid of an artifact. |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 */ |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 public abstract void describe( |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 Document document, |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 Node rootNode, |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 CallContext context, |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 String uuid |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 ); |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 } |
265f150f4f7f
Added an abstract implementation of a State.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |