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 Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.compiler.lookup;
13 import org.eclipse.jdt.internal.compiler.impl.Constant;
16 * Binding denoting a field after type substitution got performed.
17 * On parameterized type bindings, all fields got substituted, regardless whether
18 * their signature did involve generics or not, so as to get the proper declaringClass for
21 public class ParameterizedFieldBinding extends FieldBinding {
23 public FieldBinding originalField;
25 public ParameterizedFieldBinding(ParameterizedTypeBinding parameterizedDeclaringClass, FieldBinding originalField) {
28 originalField.isStatic() ? originalField.type : parameterizedDeclaringClass.substitute(originalField.type),
29 originalField.modifiers,
30 parameterizedDeclaringClass,
32 this.originalField = originalField;
35 * @see org.eclipse.jdt.internal.compiler.lookup.VariableBinding#constant()
37 public Constant constant() {
38 return this.originalField.constant();
41 * @see org.eclipse.jdt.internal.compiler.lookup.VariableBinding#isConstantValue()
43 public boolean isConstantValue() {
44 return this.originalField.isConstantValue();
47 * @see org.eclipse.jdt.internal.compiler.lookup.FieldBinding#original()
49 public FieldBinding original() {
50 return this.originalField.original();
53 * @see org.eclipse.jdt.internal.compiler.lookup.VariableBinding#constant()
55 public void setConstant(Constant constant) {
56 this.originalField.setConstant(constant);