    001// Copyright 2011 The Apache Software Foundation
    002//
    003// Licensed under the Apache License, Version 2.0 (the "License");
    004// you may not use this file except in compliance with the License.
    005// You may obtain a copy of the License at
    006//
    007// http://www.apache.org/licenses/LICENSE-2.0
    008//
    009// Unless required by applicable law or agreed to in writing, software
    010// distributed under the License is distributed on an "AS IS" BASIS,
    011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    012// See the License for the specific language governing permissions and
    013// limitations under the License.
    014
    015package org.apache.tapestry5.ioc;
    016
    017/**
    018 * Introduced for Tapestry 5.3, contains new methods to provide access to annotations on the class,
    019 * and on methods of the class. In rare cases, the same annotation type will appear on the service interface
    020 * and on the class (or method implementation in the class); the implementation annotation always
    021 * has precedence over the interface annotation.
    022 *
    023 * @since 5.3
    024 */
    025public interface AnnotationAccess
    026{
    027    /**
    028     * Returns a provider for annotations on the service class and interface. This will reflect annotations defined by
    029     * the implementation class itself, plus annotations defined by the service interface (implementation class
    030     * annotations take precedence).
    031     * @return an AnnotationProvider instance.
    032     */
    033    AnnotationProvider getClassAnnotationProvider();
    034
    035    /**
    036     * Returns a provider for annotations of a method of the class. This includes annotations on
    037     * the implementation method, plus annotations on the corresponding service interface method
    038     * (if such a method exists), with precedence on the implementation class method annotations.
    039     * @param methodName the name of the method.
    040     * @param parameterTypes the types of the parameters of the method.
    041     * @return an AnnotationProvider instance.     *
    042     */
    043    AnnotationProvider getMethodAnnotationProvider(String methodName, Class... parameterTypes);
    044
    045}