01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 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.text.edits;
11:
12: /**
13: * Thrown to indicate that an edit got added to a parent edit
14: * but the child edit somehow conflicts with the parent or
15: * one of it siblings.
16: * <p>
17: * This class is not intended to be serialized.
18: * </p>
19: *
20: * @see TextEdit#addChild(TextEdit)
21: * @see TextEdit#addChildren(TextEdit[])
22: *
23: * @since 3.0
24: */
25: public class MalformedTreeException extends RuntimeException {
26:
27: // Not intended to be serialized
28: private static final long serialVersionUID = 1L;
29:
30: private TextEdit fParent;
31: private TextEdit fChild;
32:
33: /**
34: * Constructs a new malformed tree exception.
35: *
36: * @param parent the parent edit
37: * @param child the child edit
38: * @param message the detail message
39: */
40: public MalformedTreeException(TextEdit parent, TextEdit child,
41: String message) {
42: super (message);
43: fParent = parent;
44: fChild = child;
45: }
46:
47: /**
48: * Returns the parent edit that caused the exception.
49: *
50: * @return the parent edit
51: */
52: public TextEdit getParent() {
53: return fParent;
54: }
55:
56: /**
57: * Returns the child edit that caused the exception.
58: *
59: * @return the child edit
60: */
61: public TextEdit getChild() {
62: return fChild;
63: }
64:
65: void setParent(TextEdit parent) {
66: fParent = parent;
67: }
68: }
|