KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > core > eval > GlobalVariableWrapper


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.eval;
12
13 import org.eclipse.jdt.core.eval.IGlobalVariable;
14 import org.eclipse.jdt.internal.eval.GlobalVariable;
15
16 /**
17  * A wrapper around the infrastructure global variable.
18  */

19 class GlobalVariableWrapper implements IGlobalVariable {
20     GlobalVariable variable;
21 /**
22  * Creates a new wrapper around the given infrastructure global variable.
23  */

24 GlobalVariableWrapper(GlobalVariable variable) {
25     this.variable = variable;
26 }
27 /**
28  * @see org.eclipse.jdt.core.eval.IGlobalVariable#getInitializer
29  */

30 public String JavaDoc getInitializer() {
31     char[] initializer = this.variable.getInitializer();
32     if (initializer != null) {
33         return new String JavaDoc(initializer);
34     } else {
35         return null;
36     }
37 }
38 /**
39  * @see org.eclipse.jdt.core.eval.IGlobalVariable#getName
40  */

41 public String JavaDoc getName() {
42     return new String JavaDoc(this.variable.getName());
43 }
44 /**
45  * @see org.eclipse.jdt.core.eval.IGlobalVariable#getTypeName
46  */

47 public String JavaDoc getTypeName() {
48     return new String JavaDoc(this.variable.getTypeName());
49 }
50 }
51
Popular Tags