EclipseJDT Source Viewer

Home|eclipse_jdt/src/org/eclipse/jdt/core/dom/IMemberValuePairBinding.java
1/*******************************************************************************
2 * Copyright (c) 2005, 2008 BEA Systems, Inc.
3 *
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
8 *
9 * SPDX-License-Identifier: EPL-2.0
10 *
11 * Contributors:
12 *    tyeung@bea.com - initial API and implementation
13 *    IBM Corporation - changed interface to extend IBinding
14 *    IBM Corporation - renamed from IResolvedMemberValuePair to IMemberValuePairBinding
15 *******************************************************************************/
16package org.eclipse.jdt.core.dom;
17
18/**
19 * Represents a resolved instance of an annotation's member value pair.
20 * Resolved annotation are computed along with other bindings; these objects
21 * correspond to {@link MemberValuePair} nodes.
22 *
23 * @since 3.2
24 * @noimplement This interface is not intended to be implemented by clients.
25 */
26public interface IMemberValuePairBinding extends IBinding {
27/**
28 * Returns the name of the annotation type member.
29 *
30 * @return the name of the member
31 */
32@Override
33public String getName();
34
35/**
36 * Returns the method binding corresponding to the named annotation type member.
37 *
38 * @return the method binding for the annotation type member
39 */
40public IMethodBinding getMethodBinding();
41
42/**
43 * Returns the resolved value. Resolved values are represented as follows:
44 * <ul>
45 * <li>Primitive type - the equivalent boxed object</li>
46 * <li>java.lang.Class - the <code>ITypeBinding</code> for the class object</li>
47 * <li>java.lang.String - the string value itself</li>
48 * <li>enum type - the <code>IVariableBinding</code> for the enum constant</li>
49 * <li>annotation type - an <code>IAnnotationBinding</code></li>
50 * <li>array type - an <code>Object[]</code> whose elements are as per above
51 * (the language only allows single dimensional arrays in annotations)</li>
52 * </ul>
53 *
54 * @return the resolved value, or <code>null</code> if none exists
55 */
56public Object getValue();
57
58/**
59 * @return <code>true</code> iff this member value pair's value is the default value.
60 *         Returns <code>false</code> otherwise.
61 */
62public boolean isDefault();
63}
64
MembersX
IMemberValuePairBinding:getName
IMemberValuePairBinding:isDefault
IMemberValuePairBinding:getValue
IMemberValuePairBinding:getMethodBinding
Members
X