AnnotationMirror.java revision 2571:10fc81ac75b4
1364468Scy/* 2364468Scy * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 3364468Scy * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4364468Scy * 5364468Scy * This code is free software; you can redistribute it and/or modify it 6364468Scy * under the terms of the GNU General Public License version 2 only, as 7364468Scy * published by the Free Software Foundation. Oracle designates this 8364468Scy * particular file as subject to the "Classpath" exception as provided 9364468Scy * by Oracle in the LICENSE file that accompanied this code. 10369939Sgit2svn * 11369939Sgit2svn * This code is distributed in the hope that it will be useful, but WITHOUT 12369939Sgit2svn * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13369939Sgit2svn * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14364468Scy * version 2 for more details (a copy is included in the LICENSE file that 15364468Scy * accompanied this code). 16364468Scy * 17364468Scy * You should have received a copy of the GNU General Public License version 18364468Scy * 2 along with this work; if not, write to the Free Software Foundation, 19364468Scy * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20364468Scy * 21364468Scy * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22364468Scy * or visit www.oracle.com if you need additional information or have any 23364468Scy * questions. 24364468Scy */ 25364468Scy 26364468Scypackage javax.lang.model.element; 27364468Scy 28364468Scyimport java.util.Map; 29364468Scyimport javax.lang.model.type.DeclaredType; 30364468Scy 31364468Scy/** 32364468Scy * Represents an annotation. An annotation associates a value with 33364468Scy * each element of an annotation type. 34364468Scy * 35369939Sgit2svn * <p> Annotations should be compared using the {@code equals} 36369939Sgit2svn * method. There is no guarantee that any particular annotation will 37364468Scy * always be represented by the same object. 38364468Scy * 39364468Scy * @author Joseph D. Darcy 40364468Scy * @author Scott Seligman 41364468Scy * @author Peter von der Ahé 42364468Scy * @since 1.6 43364468Scy */ 44364468Scypublic interface AnnotationMirror { 45364468Scy 46364468Scy /** 47364468Scy * Returns the type of this annotation. 48364468Scy * 49364468Scy * @return the type of this annotation 50364468Scy */ 51364468Scy DeclaredType getAnnotationType(); 52364468Scy 53364468Scy /** 54364468Scy * Returns the values of this annotation's elements. 55364468Scy * This is returned in the form of a map that associates elements 56364468Scy * with their corresponding values. 57364468Scy * Only those elements with values explicitly present in the 58364468Scy * annotation are included, not those that are implicitly assuming 59364468Scy * their default values. 60364468Scy * The order of the map matches the order in which the 61364468Scy * values appear in the annotation's source. 62364468Scy * 63364468Scy * <p>Note that an annotation mirror of a marker annotation type 64364468Scy * will by definition have an empty map. 65364468Scy * 66364468Scy * <p>To fill in default values, use {@link 67364468Scy * javax.lang.model.util.Elements#getElementValuesWithDefaults 68364468Scy * getElementValuesWithDefaults}. 69364468Scy * 70364468Scy * @return the values of this annotation's elements, 71364468Scy * or an empty map if there are none 72364468Scy */ 73364468Scy Map<? extends ExecutableElement, ? extends AnnotationValue> getElementValues(); 74364468Scy} 75364468Scy