KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > dozer > util > mapping > event > DozerEvent


1 /*
2  * Copyright 2005-2007 the original author or authors.
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 package net.sf.dozer.util.mapping.event;
17
18 import net.sf.dozer.util.mapping.fieldmap.ClassMap;
19 import net.sf.dozer.util.mapping.fieldmap.FieldMap;
20
21 /**
22  * @author garsombke.franz
23  *
24  */

25 public class DozerEvent {
26
27   private String JavaDoc type;
28   
29   private ClassMap classMap;
30
31   private FieldMap fieldMap;
32
33   private Object JavaDoc sourceObject;
34
35   private Object JavaDoc destinationObject;
36
37   private Object JavaDoc destinationValue;
38
39   public DozerEvent(String JavaDoc type, ClassMap classMap, FieldMap fieldMap, Object JavaDoc sourceObject, Object JavaDoc destinationObject,
40       Object JavaDoc destinationValue) {
41     this.type = type;
42     this.classMap = classMap;
43     this.fieldMap = fieldMap;
44     this.sourceObject = sourceObject;
45     this.destinationObject = destinationObject;
46     this.destinationValue = destinationValue;
47   }
48
49   public String JavaDoc getType() {
50     return type;
51   }
52
53   public void setType(String JavaDoc type) {
54     this.type = type;
55   }
56
57   public ClassMap getClassMap() {
58     return classMap;
59   }
60
61   public void setClassMap(ClassMap classMap) {
62     this.classMap = classMap;
63   }
64
65   public Object JavaDoc getDestinationObject() {
66     return destinationObject;
67   }
68
69   public void setDestinationObject(Object JavaDoc destinationObject) {
70     this.destinationObject = destinationObject;
71   }
72
73   public Object JavaDoc getDestinationValue() {
74     return destinationValue;
75   }
76
77   public void setDestinationValue(Object JavaDoc destinationValue) {
78     this.destinationValue = destinationValue;
79   }
80
81   public FieldMap getFieldMap() {
82     return fieldMap;
83   }
84
85   public void setFieldMap(FieldMap fieldMap) {
86     this.fieldMap = fieldMap;
87   }
88
89   public Object JavaDoc getSourceObject() {
90     return sourceObject;
91   }
92
93   public void setSourceObject(Object JavaDoc sourceObject) {
94     this.sourceObject = sourceObject;
95   }
96
97   public String JavaDoc toString() {
98     StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
99     if (getClassMap() != null) {
100       sb.append("Type:" + type + "\n");
101     }
102     if (getClassMap() != null) {
103       sb.append("ClassMap:" + getClassMap().toString() + "\n");
104     }
105     if (getFieldMap() != null) {
106       sb.append("FieldMap:" + getFieldMap().toString() + "\n");
107     }
108     if (getSourceObject() != null) {
109       sb.append("SourceObject:" + getSourceObject().toString() + "\n");
110     }
111     if (getDestinationObject() != null) {
112       sb.append("DestinationObject:" + getDestinationObject().toString() + "\n");
113     }
114     if (getDestinationValue() != null) {
115       sb.append("DestinationValue:" + getDestinationValue().toString() + "\n");
116     }
117     return sb.toString();
118   }
119 }
Popular Tags