KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > core > dom > DefaultValuePairBinding


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 BEA Systems, Inc.
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  * tyeung@bea.com - initial API and implementation
10  * IBM Corporation - implemented methods from IBinding
11  * IBM Corporation - renamed from ResolvedDefaultValuePair to DefaultValuePairBinding
12  *******************************************************************************/

13 package org.eclipse.jdt.core.dom;
14
15 import org.eclipse.jdt.core.dom.BindingResolver;
16 import org.eclipse.jdt.core.dom.IMethodBinding;
17
18 /**
19  * Member value pair which compose of default values.
20  */

21 class DefaultValuePairBinding extends MemberValuePairBinding {
22
23     private org.eclipse.jdt.internal.compiler.lookup.MethodBinding method;
24
25     DefaultValuePairBinding(org.eclipse.jdt.internal.compiler.lookup.MethodBinding binding, BindingResolver resolver) {
26         super(null, resolver);
27         this.method = binding;
28         this.value = MemberValuePairBinding.buildDOMValue(binding.getDefaultValue(), resolver);
29     }
30
31     public IMethodBinding getMethodBinding() {
32         return this.bindingResolver.getMethodBinding(this.method);
33     }
34
35     public String JavaDoc getName() {
36         return new String JavaDoc(this.method.selector);
37     }
38
39     public Object JavaDoc getValue() {
40         return this.value;
41     }
42
43     public boolean isDefault() {
44         return true;
45     }
46
47     public boolean isDeprecated() {
48         return this.method.isDeprecated();
49     }
50 }
51
Popular Tags