KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > core > dom > rewrite > RewriteEvent


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.core.dom.rewrite;
12
13
14 /**
15  *
16  */

17 public abstract class RewriteEvent {
18     
19     /**
20      * Change kind to describe that the event is an insert event.
21      * Does not apply for list events.
22      */

23     public static final int INSERTED= 1;
24     
25     /**
26      * Change kind to describe that the event is an remove event.
27      * Does not apply for list events.
28      */

29     public static final int REMOVED= 2;
30     
31     /**
32      * Change kind to describe that the event is an replace event.
33      * Does not apply for list events.
34      */

35     public static final int REPLACED= 4;
36     
37     /**
38      * Change kind to signal that children changed. Does only apply for list events.
39      */

40     public static final int CHILDREN_CHANGED= 8;
41
42     /**
43      * Change kind to signal that the property did not change
44      */

45     public static final int UNCHANGED= 0;
46     
47     /**
48      * @return Returns the event's change kind.
49      */

50     public abstract int getChangeKind();
51     
52     /**
53      * @return Returns true if the given event is a list event.
54      */

55     public abstract boolean isListRewrite();
56     
57     /**
58      * @return Returns the original value. For lists this is a <code>List<code> of ASTNode's, for non-list
59      * events this can be an ASTNode (for node properties), Integer (for an integer property),
60      * Boolean (for boolean node properties) or properties like Operator.
61      * <code>null</code> is returned if the event is a insert event.
62      */

63     public abstract Object JavaDoc getOriginalValue();
64
65     /**
66      * @return Returns the new value. For lists this is a <code>List<code> of ASTNode's, for non-list
67      * events this can be an ASTNode (for node properties), Integer (for an integer property),
68      * Boolean (for boolean node properties) or properties like Operator.
69      * <code>null</code> is returned if the event is a remove event.
70      */

71     public abstract Object JavaDoc getNewValue();
72     
73     /**
74      * @return Return the events describing the changes in a list. returns <code>null</code> if the
75      * event is not a list event.
76      */

77     public abstract RewriteEvent[] getChildren();
78     
79 }
80
Popular Tags