KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ch > ethz > inf > iks > jvmai > jvmdi > FieldJoinPointImpl


1 //
2
// This file is part of the prose package.
3
//
4
// The contents of this file are subject to the Mozilla Public License
5
// Version 1.1 (the "License"); you may not use this file except in
6
// compliance with the License. You may obtain a copy of the License at
7
// http://www.mozilla.org/MPL/
8
//
9
// Software distributed under the License is distributed on an "AS IS" basis,
10
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
// for the specific language governing rights and limitations under the
12
// License.
13
//
14
// The Original Code is prose.
15
//
16
// The Initial Developer of the Original Code is Andrei Popovici. Portions
17
// created by Andrei Popovici are Copyright (C) 2002 Andrei Popovici.
18
// All Rights Reserved.
19
//
20
// Contributor(s):
21
// $Id: FieldJoinPointImpl.java,v 1.1.1.1 2003/07/02 15:30:50 apopovic Exp $
22
// =====================================================================
23
//
24
// (history at end)
25
//
26

27 package ch.ethz.inf.iks.jvmai.jvmdi;
28
29 // used packages/classes
30
import ch.ethz.jvmai.FieldJoinPoint;
31 import java.lang.reflect.Field JavaDoc;
32 import ch.ethz.jvmai.JoinPointKinds;
33
34 /**
35  * Class FieldJoinPointImpl represents a joinpoint where
36  * a field is accessed. This class does not provide any new
37  * fields or methods.
38  *
39  * @version $Revision: 1.1.1.1 $
40  * @author Andrei Popovici
41  */

42 public class FieldJoinPointImpl extends CodeJoinPointImpl implements FieldJoinPoint,JoinPointKinds
43 {
44
45   protected Field JavaDoc field;
46   private Object JavaDoc value;
47
48
49   protected FieldJoinPointImpl(ControlFlow cflow, JoinPointContext ctx)
50     {
51       super(cflow,ctx);
52       signature = new FieldSignatureImpl(this);
53     }
54
55   /**
56      * Returns the reflective field currently accessed.
57      */

58   public Field JavaDoc getField()
59     {
60       return field;
61     }
62
63   /** Returns the value of this field.
64    */

65   public Object JavaDoc getValue()
66     {
67       return value;
68     }
69
70   public int getMask()
71     {
72       return MASK_CODE_JP | MASK_FIELD_JP;
73     }
74   /** @deprecated. use getField().getDeclaringClass() instead
75    */

76   public Class JavaDoc getTargetClass()
77     {
78     return field.getDeclaringClass();
79     }
80 }
81
82 //======================================================================
83
//
84
// $Log: FieldJoinPointImpl.java,v $
85
// Revision 1.1.1.1 2003/07/02 15:30:50 apopovic
86
// Imported from ETH Zurich
87
//
88
// Revision 1.4 2003/05/05 17:46:25 popovici
89
// Refactorization step (runes->prose) cleanup
90
//
91
// Revision 1.3 2003/04/17 08:47:04 popovici
92
// Important functionality additions
93
// - Cflow specializers
94
// - Restructuring of the MethodCut, SetCut, ExceptionCut, and GetCut (they are much smaller)
95
// - Transactional capabilities
96
// - Total refactoring of Specializer evaluation, which permits fine-grained distinction
97
// between static and dynamic specializers.
98
// - Functionality pulled up in abstract classes
99
// - Uniformization of advice methods patterns and names
100
//
101
// Revision 1.2 2003/03/04 16:09:34 popovici
102
// Documentation improvements
103
//
104
// Revision 1.1 2003/03/04 11:26:35 popovici
105
// Important refactorization step (march):
106
// - removal of 'JoinPointEvents'; JoinPoints now have the same function as events
107
// - reimplementation of the JVMAIDebuggerAspectInterface (better performance, coding conventions, removal of ProseVM
108
// structures
109
//
110
//
111
Popular Tags