001 /* 002 Copyright (C) 2001-2003 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.core.rtti; 019 020 021 /** 022 * This class defines the super class for all the meta items whithin 023 * the rtti aspect.<p> 024 * 025 * A meta item encapsulates a <code>java.lang.reflect</code> item so 026 * that the user of this item can add extra informations 027 * (attributes). Typically this feature can be used by an aspect to 028 * tag an element of the model to react to this tag later on.<p> 029 * 030 * Examples:<p> <ul> 031 * 032 * <li>A persistence aspect can tag some field persistent, add methods 033 * that change the object states even if they do not fit naming 034 * conventions...<p> 035 * 036 * <li>A GUI can tag a given field to be invisible or a class to be 037 * displayed by a special view (eg a given Swing component)... 038 * 039 * </ul> 040 * 041 * @author Renaud Pawlak 042 * @author Laurent Martelli 043 */ 044 045 public interface LoadtimeRTTI { 046 /** 047 * Tells that a method modifies a field 048 */ 049 void addltModifiedField(String className, String methodSign, String fieldName); 050 051 /** 052 * Tells that a method reads a field 053 */ 054 void addltAccessedField(String className, String methodSign, String fieldName); 055 056 /** 057 * Tells that a method calls add on a collection field 058 */ 059 void addltAddedCollection(String className, String methodSign, String fieldName); 060 061 /** 062 * Tells that a method calls remove on a collection field 063 */ 064 void addltRemovedCollection(String className, String methodSign, String fieldName); 065 066 /** 067 * Tells that a method calls modifies the content of a collection field 068 */ 069 void addltModifiedCollection(String className, String methodSign, String fieldName); 070 071 /** 072 * Tells that a method is the setter of a field (sets the field 073 * with the value of a parameter) 074 */ 075 void addltSetField(String className, String methodSign, String fieldName); 076 077 /** 078 * Tells that a method returns the value of field 079 */ 080 void addltReturnedField(String className, String methodSign, String fieldName); 081 082 /** 083 * Tells wether a method is a getter of a field or not 084 */ 085 void setltIsGetter(String className, String methodSign, boolean isGetter); 086 087 /** 088 * Returns the class info of a class 089 */ 090 ClassInfo getClassInfo(String className); 091 092 /** 093 * 094 */ 095 void setClassInfo(String className, ClassInfo classInfo); 096 097 /** 098 * Tells that a method's parameter is used as an index of a 099 * collection field 100 */ 101 void setCollectionIndexArgument(String className, String method, int argument); 102 103 /** 104 * Tells that a method's parameter is used as an item to be added 105 * to a collection field 106 */ 107 void setCollectionItemArgument(String className, String method, int argument); 108 109 /** 110 * Tells that a method calls the super method 111 */ 112 void setCallSuper(String className, String method); 113 114 /** 115 * Tells that a method invokes another method 116 */ 117 void addInvokedMethod(String className, String methodSign, 118 InvokeInfo invokeInfo); 119 }