KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > debugger > jpda > expr > Identifier


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.debugger.jpda.expr;
21
22 import com.sun.jdi.ReferenceType;
23 import com.sun.jdi.ObjectReference;
24
25 /**
26  * A simple bean encapsulating information needed to resolve a given name (or identifier). The identifier may
27  * be resolved in an instance, type or local context.
28  *
29  * @author Maros Sandor
30  */

31 class Identifier {
32
33     ReferenceType typeContext;
34     ObjectReference instanceContext;
35     String JavaDoc superQualifier;
36     String JavaDoc identifier;
37     boolean localContext;
38
39     Identifier(boolean localContext, ObjectReference instanceContext, String JavaDoc identifier) {
40         this.localContext = localContext;
41         this.instanceContext = instanceContext;
42         if (instanceContext != null) {
43             this.typeContext = instanceContext.referenceType();
44         }
45         this.identifier = identifier;
46     }
47
48     Identifier(boolean localContext, ObjectReference objectReference, ReferenceType typeContext, String JavaDoc identifier) {
49         this.localContext = localContext;
50         this.instanceContext = objectReference;
51         this.typeContext = typeContext;
52         this.identifier = identifier;
53     }
54
55     Identifier(boolean localContext, ReferenceType typeContext, String JavaDoc identifier) {
56         this.localContext = localContext;
57         this.typeContext = typeContext;
58         this.identifier = identifier;
59     }
60
61     Identifier(ObjectReference objectReference, String JavaDoc identifier, String JavaDoc superQualifier) {
62         this.instanceContext = objectReference;
63         this.typeContext = instanceContext.referenceType();
64         this.identifier = identifier;
65         this.superQualifier = superQualifier;
66     }
67
68     Identifier(ReferenceType typeContext, String JavaDoc identifier) {
69         this.typeContext = typeContext;
70         this.identifier = identifier;
71     }
72 }
73
Popular Tags