Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
MapperFactoryEvent |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2003-2004 The Apache Software Foundation. | |
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.apache.commons.mapper; | |
18 | ||
19 | import java.util.EventObject; | |
20 | ||
21 | /** | |
22 | * An event that MapperFactory generates. | |
23 | */ | |
24 | public class MapperFactoryEvent extends EventObject { | |
25 | ||
26 | /** | |
27 | * A Mapper related to this event. | |
28 | */ | |
29 | 0 | private Mapper mapper = null; |
30 | ||
31 | /** | |
32 | * Constructor for MapperFactoryEvent. | |
33 | * @param factory The MapperFactory that generated the event. | |
34 | */ | |
35 | public MapperFactoryEvent(MapperFactory factory) { | |
36 | 0 | super(factory); |
37 | 0 | } |
38 | ||
39 | /** | |
40 | * Constructor for MapperFactoryEvent. | |
41 | * @param factory The MapperFactory that generated the event. | |
42 | * @param mapper A Mapper related to this event. | |
43 | */ | |
44 | public MapperFactoryEvent(MapperFactory factory, Mapper mapper) { | |
45 | 0 | super(factory); |
46 | 0 | this.mapper = mapper; |
47 | 0 | } |
48 | ||
49 | /** | |
50 | * @return The Mapper that is related to this event. | |
51 | */ | |
52 | public Mapper getMapper() { | |
53 | 0 | return this.mapper; |
54 | } | |
55 | ||
56 | /** | |
57 | * @return The MapperFactory that generated this event. | |
58 | */ | |
59 | public MapperFactory getMapperFactory() { | |
60 | 0 | return (MapperFactory) this.source; |
61 | } | |
62 | ||
63 | } |