View Javadoc

1   /*
2    * Copyright 2008 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 1.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.opensource.org/licenses/ecl1.php
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  package org.kuali.student.r1.common.assembly;
17  
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  
22  /**
23   * A node in the sorted map of disassembled base DTOs. The node provides the
24   * data for the base DTO along with the operation information on the data.
25   * 
26   * The consumer of the map of these nodes is required to process the nodes in
27   * sorted order to guarantee data integrity within the base DTOs.
28   * 
29   * @author Kuali Student Team
30   * 
31   */
32  @Deprecated
33  public class BaseDTOAssemblyNode<E,T> {
34  
35  	public enum NodeOperation {
36  		CREATE, UPDATE, DELETE;
37  	}
38  
39  	protected NodeOperation operation;
40  
41  	protected E businessDTORef;
42  	
43  	protected T nodeData;
44  
45  	
46  	protected BOAssembler<E, T> assembler;
47  	
48  	protected List<BaseDTOAssemblyNode<?,?>> childNodes;
49  
50  	public BaseDTOAssemblyNode(BOAssembler<E, T> assembler) {
51  		super();
52  		this.assembler = assembler;
53  	}
54  
55  	/**
56  	 * @return the nodeData
57  	 */
58  	public T getNodeData() {
59  		return nodeData;
60  	}
61  
62  	/**
63  	 * @param nodeData
64  	 *            the nodeData to set
65  	 */
66  	public void setNodeData(T nodeData) {
67  		this.nodeData = nodeData;
68  	}
69  
70  	/**
71  	 * @return the operation
72  	 */
73  	public NodeOperation getOperation() {
74  		return operation;
75  	}
76  
77  	/**
78  	 * @param operation
79  	 *            the operation to set
80  	 */
81  	public void setOperation(NodeOperation operation) {
82  		this.operation = operation;
83  	}
84  
85  	public List<BaseDTOAssemblyNode<?,?>> getChildNodes() {
86  		if (childNodes == null) {
87  			childNodes = new ArrayList<BaseDTOAssemblyNode<?,?>>();
88  		}
89  		return childNodes;
90  	}
91  
92  	public void setChildNodes(List<BaseDTOAssemblyNode<?,?>> childNodes) {
93  		this.childNodes = childNodes;
94  	}
95  	
96  	/**
97  	 * @return the assembler
98  	 */
99  	public BOAssembler<E, T> getAssembler() {
100 		return assembler;
101 	}
102 
103 	/**
104 	 * @param assembler the assembler to set
105 	 */
106 	public void setAssembler(BOAssembler<E, T> assembler) {
107 		this.assembler = assembler;
108 	}
109 
110 	/**
111 	 * @return the businessDTORef
112 	 */
113 	public E getBusinessDTORef() {
114 		return businessDTORef;
115 	}
116 
117 	/**
118 	 * @param businessDTORef the businessDTORef to set
119 	 */
120 	public void setBusinessDTORef(E businessDTORef) {
121 		this.businessDTORef = businessDTORef;
122 	}
123 	
124 }