]>
git.argeo.org Git - gpl/argeo-slc.git/blob - DefaultRunnableDataNode.java
536ccd5ba2ed3f4108a0673f3a41013de15dce28
2 * Copyright (C) 2007-2012 Mathieu Baudier
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.
16 package org
.argeo
.slc
.core
.execution
.generator
;
18 import java
.util
.ArrayList
;
19 import java
.util
.HashMap
;
20 import java
.util
.List
;
24 * Default implementation of <code>RunnableDataNode</code>
27 public class DefaultRunnableDataNode
implements RunnableDataNode
{
29 private List
<RunnableDataNode
> children
= new ArrayList
<RunnableDataNode
>();
31 private RunnableDataNode parent
;
34 * Data of the RunnableDataNode. Does not contain
37 private Map
<String
, Object
> properData
= new HashMap
<String
, Object
>();
41 private String beanName
;
43 public boolean isLeaf() {
44 return children
.size() == 0;
47 public List
<RunnableDataNode
> getChildren() {
51 public void addChild(RunnableDataNode child
) {
52 child
.setParent(this);
56 public Map
<String
, Object
> getData() {
57 Map
<String
, Object
> data
= new HashMap
<String
, Object
>();
59 Map
<String
, Object
> parentData
= parent
.getData();
60 if(parentData
!= null) {
61 data
.putAll(parentData
);
64 // entries defined in parentData can be overridden
66 if(properData
!= null) {
67 data
.putAll(properData
);
72 public Map
<String
, Object
> getProperData() {
76 public void setProperData(Map
<String
, Object
> properData
) {
77 this.properData
= properData
;
80 public String
getPath() {
84 public void setPath(String path
) {
88 public String
getBeanName() {
92 public void setBeanName(String beanName
) {
93 this.beanName
= beanName
;
96 public void setParent(RunnableDataNode parent
) {
100 public RunnableDataNode
getParent() {