KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > eval > ast > instructions > PushClassLiteralValue


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.debug.eval.ast.instructions;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.jdt.debug.core.IJavaType;
15
16 /**
17  * Handles code like "new Object().class"
18  */

19 public class PushClassLiteralValue extends CompoundInstruction {
20     public PushClassLiteralValue(int start) {
21         super(start);
22     }
23     
24     /**
25      * @see Instruction#execute()
26      */

27     public void execute() throws CoreException {
28         IJavaType type = (IJavaType)pop();
29         push(getClassObject(type));
30     }
31
32     /*
33      * @see Object#toString()
34      */

35     public String JavaDoc toString() {
36         return InstructionsEvaluationMessages.PushClassLiteralValue_push_class_literal_value_1;
37     }
38
39 }
40
Popular Tags