KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > core > rtti > ClassInfo


1 /*
2   Copyright (C) 2001-2003 Laurent Martelli <laurent@aopsys.com>
3   
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU Lesser General Public License as
6   published by the Free Software Foundation; either version 2 of the
7   License, or (at your option) any later version.
8
9   This program is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12   GNU Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public License
15   along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */

17
18 package org.objectweb.jac.core.rtti;
19
20 import java.io.Serializable JavaDoc;
21 import java.util.Hashtable JavaDoc;
22 import java.util.Map JavaDoc;
23
24 public class ClassInfo implements Serializable JavaDoc {
25    Map JavaDoc methodInfos = new Hashtable JavaDoc();
26    public MethodInfo getMethodInfo(String JavaDoc method) {
27       MethodInfo methodinfo = (MethodInfo)methodInfos.get(method);
28       if (methodinfo==null) {
29          methodinfo = new MethodInfo();
30          methodInfos.put(method,methodinfo);
31       }
32       return methodinfo;
33    }
34    public void addModifiedField(String JavaDoc method, String JavaDoc field) {
35       getMethodInfo(method).modifiedFields.add(field);
36    }
37    public void addAccessedField(String JavaDoc method, String JavaDoc field) {
38       getMethodInfo(method).accessedFields.add(field);
39    }
40    public void setReturnedField(String JavaDoc method, String JavaDoc field) {
41       getMethodInfo(method).returnedField = field;
42    }
43    public void setIsGetter(String JavaDoc method, boolean isGetter) {
44       getMethodInfo(method).isGetter = isGetter;
45    }
46    public void addSetField(String JavaDoc method, String JavaDoc field) {
47       getMethodInfo(method).setFields.add(field);
48    }
49    public void addAddedCollection(String JavaDoc method, String JavaDoc field) {
50       getMethodInfo(method).addedCollections.add(field);
51    }
52    public void addRemovedCollection(String JavaDoc method, String JavaDoc field) {
53       getMethodInfo(method).removedCollections.add(field);
54    }
55    public void addModifiedCollection(String JavaDoc method, String JavaDoc field) {
56       getMethodInfo(method).modifiedCollections.add(field);
57    }
58    public void setCollectionIndexArgument(String JavaDoc method, int argument) {
59       getMethodInfo(method).collectionIndexArgument = argument;
60    }
61    public void setCollectionItemArgument(String JavaDoc method, int argument) {
62       getMethodInfo(method).collectionItemArgument = argument;
63    }
64    public void addInvokedMethod(String JavaDoc method,InvokeInfo invokeInfo) {
65       getMethodInfo(method).invokedMethods.add(invokeInfo);
66    }
67 }
68
Popular Tags