001 /* 002 Copyright (C) 2004 Laurent Martelli <laurent@aopsys.com> 003 004 This program is free software; you can redistribute it and/or modify 005 it under the terms of the GNU Lesser General Public License as 006 published by the Free Software Foundation; either version 2 of the 007 License, or (at your option) any later version. 008 009 This program is distributed in the hope that it will be useful, 010 but WITHOUT ANY WARRANTY; without even the implied warranty of 011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 012 GNU Lesser General Public License for more details. 013 014 You should have received a copy of the GNU Lesser General Public License 015 along with this program; if not, write to the Free Software 016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 017 018 package org.objectweb.jac.aspects.gui; 019 020 import java.util.Arrays; 021 import org.objectweb.jac.core.rtti.AbstractMethodItem; 022 023 /** 024 * Event for a method invocation 025 */ 026 public class InvokeEvent extends SubstanceEvent { 027 public InvokeEvent(View source, 028 Object substance, AbstractMethodItem method, 029 Object[] parameters) { 030 super(source,substance); 031 this.method = method; 032 this.parameters = parameters; 033 } 034 035 public InvokeEvent(View source, 036 Object substance, AbstractMethodItem method) { 037 super(source,substance); 038 this.method = method; 039 } 040 041 /** Invoked method */ 042 AbstractMethodItem method; 043 public AbstractMethodItem getMethod() { 044 return method; 045 } 046 public void setMethod(AbstractMethodItem newMethod) { 047 this.method = newMethod; 048 } 049 050 Object[] parameters; 051 public Object[] getParameters() { 052 return parameters; 053 } 054 public void setParameters(Object[] newParameters) { 055 this.parameters = newParameters; 056 } 057 058 public String toString() { 059 return "InvokeEvent{source="+source+", "+substance+"."+method.getLongName()+ 060 " with "+(parameters!=null?Arrays.asList(parameters):null)+"}"; 061 } 062 }