jaroslav@66: /* jaroslav@66: * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. jaroslav@66: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jaroslav@66: * jaroslav@66: * This code is free software; you can redistribute it and/or modify it jaroslav@66: * under the terms of the GNU General Public License version 2 only, as jaroslav@66: * published by the Free Software Foundation. Oracle designates this jaroslav@66: * particular file as subject to the "Classpath" exception as provided jaroslav@66: * by Oracle in the LICENSE file that accompanied this code. jaroslav@66: * jaroslav@66: * This code is distributed in the hope that it will be useful, but WITHOUT jaroslav@66: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jaroslav@66: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jaroslav@66: * version 2 for more details (a copy is included in the LICENSE file that jaroslav@66: * accompanied this code). jaroslav@66: * jaroslav@66: * You should have received a copy of the GNU General Public License version jaroslav@66: * 2 along with this work; if not, write to the Free Software Foundation, jaroslav@66: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jaroslav@66: * jaroslav@66: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jaroslav@66: * or visit www.oracle.com if you need additional information or have any jaroslav@66: * questions. jaroslav@66: */ jaroslav@66: jaroslav@66: package java.lang.annotation; jaroslav@66: jaroslav@66: /** jaroslav@66: * The common interface extended by all annotation types. Note that an jaroslav@66: * interface that manually extends this one does not define jaroslav@66: * an annotation type. Also note that this interface does not itself jaroslav@66: * define an annotation type. jaroslav@66: * jaroslav@66: * More information about annotation types can be found in section 9.6 of jaroslav@66: * The Java™ Language Specification. jaroslav@66: * jaroslav@66: * @author Josh Bloch jaroslav@66: * @since 1.5 jaroslav@66: */ jaroslav@66: public interface Annotation { jaroslav@66: /** jaroslav@66: * Returns true if the specified object represents an annotation jaroslav@66: * that is logically equivalent to this one. In other words, jaroslav@66: * returns true if the specified object is an instance of the same jaroslav@66: * annotation type as this instance, all of whose members are equal jaroslav@66: * to the corresponding member of this annotation, as defined below: jaroslav@66: * jaroslav@66: * jaroslav@66: * @return true if the specified object represents an annotation jaroslav@66: * that is logically equivalent to this one, otherwise false jaroslav@66: */ jaroslav@66: boolean equals(Object obj); jaroslav@66: jaroslav@66: /** jaroslav@66: * Returns the hash code of this annotation, as defined below: jaroslav@66: * jaroslav@66: *

The hash code of an annotation is the sum of the hash codes jaroslav@66: * of its members (including those with default values), as defined jaroslav@66: * below: jaroslav@66: * jaroslav@66: * The hash code of an annotation member is (127 times the hash code jaroslav@66: * of the member-name as computed by {@link String#hashCode()}) XOR jaroslav@66: * the hash code of the member-value, as defined below: jaroslav@66: * jaroslav@66: *

The hash code of a member-value depends on its type: jaroslav@66: *

jaroslav@66: * jaroslav@66: * @return the hash code of this annotation jaroslav@66: */ jaroslav@66: int hashCode(); jaroslav@66: jaroslav@66: /** jaroslav@66: * Returns a string representation of this annotation. The details jaroslav@66: * of the representation are implementation-dependent, but the following jaroslav@66: * may be regarded as typical: jaroslav@66: *
jaroslav@66:      *   @com.acme.util.Name(first=Alfred, middle=E., last=Neuman)
jaroslav@66:      * 
jaroslav@66: * jaroslav@66: * @return a string representation of this annotation jaroslav@66: */ jaroslav@66: String toString(); jaroslav@66: jaroslav@66: /** jaroslav@66: * Returns the annotation type of this annotation. jaroslav@66: */ jaroslav@66: Class annotationType(); jaroslav@66: }