450215f04e7fba3e99fb3309ce0fe311a2468ffa
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / core / dom / DefaultValuePairBinding.java
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 net.sourceforge.phpdt.core.dom;
14
15 import net.sourceforge.phpdt.core.dom.BindingResolver;
16 import net.sourceforge.phpdt.core.dom.IMethodBinding;
17
18 /**
19  * Member value pair which compose of default values.
20  */
21 class DefaultValuePairBinding extends MemberValuePairBinding {
22
23         private net.sourceforge.phpdt.internal.compiler.lookup.MethodBinding method;
24
25         DefaultValuePairBinding(net.sourceforge.phpdt.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 getName() {
36                 return new String(this.method.selector);
37         }
38
39         public Object 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 }