001: //
002: // This file is part of the prose package.
003: //
004: // The contents of this file are subject to the Mozilla Public License
005: // Version 1.1 (the "License"); you may not use this file except in
006: // compliance with the License. You may obtain a copy of the License at
007: // http://www.mozilla.org/MPL/
008: //
009: // Software distributed under the License is distributed on an "AS IS" basis,
010: // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
011: // for the specific language governing rights and limitations under the
012: // License.
013: //
014: // The Original Code is prose.
015: //
016: // The Initial Developer of the Original Code is Andrei Popovici. Portions
017: // created by Andrei Popovici are Copyright (C) 2002 Andrei Popovici.
018: // All Rights Reserved.
019: //
020: // Contributor(s):
021: // $Id: FieldJoinPointImpl.java,v 1.1.1.1 2003/07/02 15:30:50 apopovic Exp $
022: // =====================================================================
023: //
024: // (history at end)
025: //
026:
027: package ch.ethz.inf.iks.jvmai.jvmdi;
028:
029: // used packages/classes
030: import ch.ethz.jvmai.FieldJoinPoint;
031: import java.lang.reflect.Field;
032: import ch.ethz.jvmai.JoinPointKinds;
033:
034: /**
035: * Class FieldJoinPointImpl represents a joinpoint where
036: * a field is accessed. This class does not provide any new
037: * fields or methods.
038: *
039: * @version $Revision: 1.1.1.1 $
040: * @author Andrei Popovici
041: */
042: public class FieldJoinPointImpl extends CodeJoinPointImpl implements
043: FieldJoinPoint, JoinPointKinds {
044:
045: protected Field field;
046: private Object value;
047:
048: protected FieldJoinPointImpl(ControlFlow cflow, JoinPointContext ctx) {
049: super (cflow, ctx);
050: signature = new FieldSignatureImpl(this );
051: }
052:
053: /**
054: * Returns the reflective field currently accessed.
055: */
056: public Field getField() {
057: return field;
058: }
059:
060: /** Returns the value of this field.
061: */
062: public Object getValue() {
063: return value;
064: }
065:
066: public int getMask() {
067: return MASK_CODE_JP | MASK_FIELD_JP;
068: }
069:
070: /** @deprecated use getField().getDeclaringClass() instead
071: */
072: public Class getTargetClass() {
073: return field.getDeclaringClass();
074: }
075: }
076:
077: //======================================================================
078: //
079: // $Log: FieldJoinPointImpl.java,v $
080: // Revision 1.1.1.1 2003/07/02 15:30:50 apopovic
081: // Imported from ETH Zurich
082: //
083: // Revision 1.4 2003/05/05 17:46:25 popovici
084: // Refactorization step (runes->prose) cleanup
085: //
086: // Revision 1.3 2003/04/17 08:47:04 popovici
087: // Important functionality additions
088: // - Cflow specializers
089: // - Restructuring of the MethodCut, SetCut, ExceptionCut, and GetCut (they are much smaller)
090: // - Transactional capabilities
091: // - Total refactoring of Specializer evaluation, which permits fine-grained distinction
092: // between static and dynamic specializers.
093: // - Functionality pulled up in abstract classes
094: // - Uniformization of advice methods patterns and names
095: //
096: // Revision 1.2 2003/03/04 16:09:34 popovici
097: // Documentation improvements
098: //
099: // Revision 1.1 2003/03/04 11:26:35 popovici
100: // Important refactorization step (march):
101: // - removal of 'JoinPointEvents'; JoinPoints now have the same function as events
102: // - reimplementation of the JVMAIDebuggerAspectInterface (better performance, coding conventions, removal of ProseVM
103: // structures
104: //
105: //
|