1 /*******************************************************************************
2 * Copyright (c) 2000, 2007 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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.core;
14 * Common protocol for Java elements that can be annotated.
16 * This interface is not intended to be implemented by clients.
21 public interface IAnnotatable {
24 * Returns the annotation with the given name declared on this element.
25 * This is a handle-only method. The annotation may or may not exist.
27 * @param name the given simple name
28 * @return the annotation with the given name declared on this element
30 IAnnotation getAnnotation(String name);
33 * Returns the annotations for this element.
34 * Returns an empty array if this method has no annotations.
36 * @exception JavaModelException if this element does not exist or if an
37 * exception occurs while accessing its corresponding resource.
38 * @return the annotations of this element,
39 * in the order declared in the source, or an empty array if none
42 IAnnotation[] getAnnotations() throws JavaModelException;