01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.portal.event.impl;
18:
19: import org.apache.cocoon.portal.aspect.Aspectalizable;
20: import org.apache.cocoon.portal.event.ActionEvent;
21: import org.apache.cocoon.portal.event.ComparableEvent;
22: import org.apache.cocoon.portal.event.RequestEvent;
23:
24: /**
25: * This events set the aspect data for an {@link Aspectalizable} object
26: *
27: * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
28: *
29: * @version CVS $Id: ChangeAspectDataEvent.java 433543 2006-08-22 06:22:54Z crossley $
30: */
31: public class ChangeAspectDataEvent extends AbstractActionEvent
32: implements ActionEvent, RequestEvent, ComparableEvent {
33:
34: protected String aspectName;
35:
36: protected Object data;
37:
38: protected String requestParameterName;
39:
40: public ChangeAspectDataEvent(Aspectalizable target,
41: String aspectName, Object data) {
42: super (target);
43: this .aspectName = aspectName;
44: this .data = data;
45: }
46:
47: /**
48: * @return The aspect name
49: */
50: public String getAspectName() {
51: return this .aspectName;
52: }
53:
54: /**
55: * @return The value to set
56: */
57: public Object getData() {
58: return this .data;
59: }
60:
61: /**
62: * @return The target to change
63: */
64: public Object getTarget() {
65: return this .target;
66: }
67:
68: public Aspectalizable getAspectalizable() {
69: return (Aspectalizable) this .target;
70: }
71:
72: /* (non-Javadoc)
73: * @see org.apache.cocoon.portal.event.RequestEvent#getRequestParameterName()
74: */
75: public String getRequestParameterName() {
76: return this .requestParameterName;
77: }
78:
79: public void setRequestParameterName(String value) {
80: this .requestParameterName = value;
81: }
82:
83: /* (non-Javadoc)
84: * @see org.apache.cocoon.portal.event.ComparableEvent#equalsEvent(org.apache.cocoon.portal.event.ComparableEvent)
85: */
86: public boolean equalsEvent(ComparableEvent event) {
87: if (event instanceof ChangeAspectDataEvent) {
88: ChangeAspectDataEvent other = (ChangeAspectDataEvent) event;
89: return (this .getTarget().equals(other.getTarget()) && this
90: .getAspectName().equals(other.getAspectName()));
91: }
92:
93: return false;
94: }
95:
96: }
|