01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdi.internal.event;
11:
12: import java.io.DataInputStream;
13: import java.io.IOException;
14:
15: import org.eclipse.jdi.internal.MirrorImpl;
16: import org.eclipse.jdi.internal.ValueImpl;
17: import org.eclipse.jdi.internal.VirtualMachineImpl;
18: import org.eclipse.jdi.internal.request.RequestID;
19:
20: import com.sun.jdi.Value;
21: import com.sun.jdi.event.ModificationWatchpointEvent;
22:
23: /**
24: * this class implements the corresponding interfaces
25: * declared by the JDI specification. See the com.sun.jdi package
26: * for more information.
27: *
28: */
29: public class ModificationWatchpointEventImpl extends
30: WatchpointEventImpl implements ModificationWatchpointEvent {
31: /** Jdwp Event Kind. */
32: public static final byte EVENT_KIND = EVENT_FIELD_MODIFICATION;
33:
34: /** Value to be assigned. */
35: private ValueImpl fValueToBe;
36:
37: /**
38: * Creates new ModificationWatchpointEventImpl.
39: */
40: private ModificationWatchpointEventImpl(VirtualMachineImpl vmImpl,
41: RequestID requestID) {
42: super ("ModificationWatchpointEvent", vmImpl, requestID); //$NON-NLS-1$
43: }
44:
45: /**
46: * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
47: */
48: public static WatchpointEventImpl read(MirrorImpl target,
49: RequestID requestID, DataInputStream dataInStream)
50: throws IOException {
51: VirtualMachineImpl vmImpl = target.virtualMachineImpl();
52: ModificationWatchpointEventImpl event = new ModificationWatchpointEventImpl(
53: vmImpl, requestID);
54: event.readWatchpointEventFields(target, dataInStream);
55: event.fValueToBe = ValueImpl.readWithTag(target, dataInStream);
56: return event;
57: }
58:
59: /**
60: * @return Returns value that will be assigned to the field when the instruction completes.
61: */
62: public Value valueToBe() {
63: return fValueToBe;
64: }
65: }
|