]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/generator/RunnableDataNode.java
Execution attribute of type ref now supported (break data model)
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / execution / generator / RunnableDataNode.java
1 /*
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.argeo.slc.core.execution.generator;
18
19 import java.util.List;
20 import java.util.Map;
21
22 /**
23 * Stores information relative to a Runnable.
24 * Allows to structure the information as a tree, each node
25 * storing data as a Map.
26 */
27 public interface RunnableDataNode {
28
29 /**
30 * @return a Map containing the data associated with this node.
31 * Data associated with parent nodes are expected
32 * to be contained in the returned Map
33 */
34 public Map<String, Object> getData();
35
36 /**
37 * @return the name of the bean to create.
38 * Can be null if no bean shall be created for the
39 * <code>RunnableDataNode</code> (e.g. is is a sub-node)
40 */
41 public String getBeanName();
42
43 /**
44 * @return the path of the flow bean to create.
45 * Can be null if the bean to created is not an
46 * <code>ExecutionFlow</code> or if no bean shall be created for the
47 * <code>RunnableDataNode</code> (e.g. is is a sub-node)
48 */
49 public String getPath();
50
51 /**
52 * @return whether the <code>RunnableDataNode</code> has
53 * children or not.
54 * Expected to be equivalent to <code>getChildren().empty()</code>
55 */
56 public boolean isLeaf();
57
58 /**
59 * @return the list of <code>RunnableDataNode</code> children.
60 * Can be empty. Shall not be null.
61 */
62 public List<RunnableDataNode> getChildren();
63
64 /**
65 * @return the <code>RunnableDataNode</code> parent.
66 * Can be null if no parent is defined (top node).
67 */
68 public RunnableDataNode getParent();
69
70 /**
71 * Sets the <code>RunnableDataNode</code> parent
72 * @param parent
73 */
74 public void setParent(RunnableDataNode parent);
75 }