KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > event > impl > ChangeAspectDataEvent


1 /*
2  * Copyright 1999-2002,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 package org.apache.cocoon.portal.event.impl;
17
18 import org.apache.cocoon.portal.aspect.Aspectalizable;
19 import org.apache.cocoon.portal.event.ActionEvent;
20 import org.apache.cocoon.portal.event.ComparableEvent;
21 import org.apache.cocoon.portal.event.RequestEvent;
22
23 /**
24  * This events set the aspect data for an {@link Aspectalizable} object
25  *
26  * @author <a HREF="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
27  *
28  * @version CVS $Id: ChangeAspectDataEvent.java 30932 2004-07-29 17:35:38Z vgritsenko $
29  */

30 public class ChangeAspectDataEvent
31     extends AbstractActionEvent
32     implements ActionEvent, RequestEvent, ComparableEvent {
33
34     protected String JavaDoc aspectName;
35     
36     protected Object JavaDoc data;
37     
38     protected String JavaDoc requestParameterName;
39     
40     
41     public ChangeAspectDataEvent(Aspectalizable target, String JavaDoc aspectName, Object JavaDoc data) {
42         super(target);
43         this.aspectName = aspectName;
44         this.data = data;
45     }
46
47     /**
48      * @return The aspect name
49      */

50     public String JavaDoc getAspectName() {
51         return this.aspectName;
52     }
53
54     /**
55      * @return The value to set
56      */

57     public Object JavaDoc getData() {
58         return this.data;
59     }
60
61     /**
62      * @return The target to change
63      */

64     public Object JavaDoc getTarget() {
65         return this.target;
66     }
67
68
69     public Aspectalizable getAspectalizable() {
70         return (Aspectalizable)this.target;
71     }
72     
73     /* (non-Javadoc)
74      * @see org.apache.cocoon.portal.event.RequestEvent#getRequestParameterName()
75      */

76     public String JavaDoc getRequestParameterName() {
77         return this.requestParameterName;
78     }
79
80     public void setRequestParameterName(String JavaDoc value) {
81         this.requestParameterName = value;
82     }
83     
84     /* (non-Javadoc)
85      * @see org.apache.cocoon.portal.event.ComparableEvent#equalsEvent(org.apache.cocoon.portal.event.ComparableEvent)
86      */

87     public boolean equalsEvent(ComparableEvent event) {
88         if ( event instanceof ChangeAspectDataEvent ) {
89             ChangeAspectDataEvent other = (ChangeAspectDataEvent)event;
90             return (this.getTarget().equals(other.getTarget())
91                      && this.getAspectName().equals(other.getAspectName()));
92         }
93
94         return false;
95     }
96
97 }
98
Popular Tags