KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > annotation > HandlerProcessingResult


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.deployment.annotation;
25
26 import java.util.Map JavaDoc;
27 import java.lang.annotation.Annotation JavaDoc;
28
29 /**
30  * This interface defines the result of an annotation processing
31  * returned by an annotation handler. Annotation handlers are supposed
32  * to handle ONE annotation at a time. However, this simplistic
33  * approach does not always work as annotations on a element can have
34  * interdependencies.
35  *
36  * This could be resolved trough sophisticated caching in the context
37  * for instance but it is usually easier to notify the processor that
38  * a particular annotation handler has processed more than one annotation
39  * (which shouldn't be reprocessed subsequently...)
40  *
41  * @author Jerome Dochez
42  */

43 public interface HandlerProcessingResult {
44     
45     /**
46      * Returns a map of annotation types processed by this handler as keys
47      * and a ResultType as a value to communicate the result of the annotation
48      * processing for each processed annotation types.
49      * @return the map of processed annoation types and result.
50      */

51     public Map JavaDoc<Class JavaDoc<? extends Annotation JavaDoc>,ResultType> processedAnnotations();
52     
53     /**
54      * @return the overall result for this handler processing. Since handlers
55      * can process more than one annotation, this overall result will contain
56      * the most severe error the haandler encountered while processing the
57      * annotations.
58      */

59      public ResultType getOverallResult();
60 }
61
Popular Tags