]>
git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/generator/DefaultRunnableDataNode.java
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org
.argeo
.slc
.core
.execution
.generator
;
19 import java
.util
.ArrayList
;
20 import java
.util
.HashMap
;
21 import java
.util
.List
;
25 * Default implementation of <code>RunnableDataNode</code>
28 public class DefaultRunnableDataNode
implements RunnableDataNode
{
30 private List
<RunnableDataNode
> children
= new ArrayList
<RunnableDataNode
>();
32 private RunnableDataNode parent
;
35 * Data of the RunnableDataNode. Does not contain
38 private Map
<String
, Object
> properData
= new HashMap
<String
, Object
>();
42 private String beanName
;
44 public boolean isLeaf() {
45 return children
.size() == 0;
48 public List
<RunnableDataNode
> getChildren() {
52 public void addChild(RunnableDataNode child
) {
53 child
.setParent(this);
57 public Map
<String
, Object
> getData() {
58 Map
<String
, Object
> data
= new HashMap
<String
, Object
>();
60 Map
<String
, Object
> parentData
= parent
.getData();
61 if(parentData
!= null) {
62 data
.putAll(parentData
);
65 // entries defined in parentData can be overridden
67 if(properData
!= null) {
68 data
.putAll(properData
);
73 public Map
<String
, Object
> getProperData() {
77 public void setProperData(Map
<String
, Object
> properData
) {
78 this.properData
= properData
;
81 public String
getPath() {
85 public void setPath(String path
) {
89 public String
getBeanName() {
93 public void setBeanName(String beanName
) {
94 this.beanName
= beanName
;
97 public void setParent(RunnableDataNode parent
) {
101 public RunnableDataNode
getParent() {