KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > compiler > lookup > ProblemMethodBinding


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.compiler.lookup;
12
13 public class ProblemMethodBinding extends MethodBinding {
14     
15     private int problemReason;
16     public MethodBinding closestMatch; // TODO (philippe) should rename into #alternateMatch
17

18 public ProblemMethodBinding(char[] selector, TypeBinding[] args, int problemReason) {
19     this.selector = selector;
20     this.parameters = (args == null || args.length == 0) ? Binding.NO_PARAMETERS : args;
21     this.problemReason = problemReason;
22     this.thrownExceptions = Binding.NO_EXCEPTIONS;
23 }
24 public ProblemMethodBinding(char[] selector, TypeBinding[] args, ReferenceBinding declaringClass, int problemReason) {
25     this.selector = selector;
26     this.parameters = (args == null || args.length == 0) ? Binding.NO_PARAMETERS : args;
27     this.declaringClass = declaringClass;
28     this.problemReason = problemReason;
29     this.thrownExceptions = Binding.NO_EXCEPTIONS;
30 }
31 public ProblemMethodBinding(MethodBinding closestMatch, char[] selector, TypeBinding[] args, int problemReason) {
32     this(selector, args, problemReason);
33     this.closestMatch = closestMatch;
34     if (closestMatch != null && problemReason != ProblemReasons.Ambiguous) this.declaringClass = closestMatch.declaringClass;
35 }
36 /* API
37 * Answer the problem id associated with the receiver.
38 * NoError if the receiver is a valid binding.
39 */

40
41 public final int problemId() {
42     return this.problemReason;
43 }
44 }
45
Popular Tags