Source Code Cross Referenced for AnnotationValueVisitor.java in  » 6.0-JDK-Core » lang » javax » lang » model » element » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » lang » javax.lang.model.element 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package javax.lang.model.element;
027
028        import java.util.List;
029
030        import javax.lang.model.type.TypeMirror;
031
032        /**
033         * A visitor of the values of annotation type elements, using a
034         * variant of the visitor design pattern.  Unlike a standard visitor
035         * which dispatches based on the concrete type of a member of a type
036         * hierarchy, this visitor dispatches based on the type of data
037         * stored; there are no distinct subclasses for storing, for example,
038         * {@code boolean} values versus {@code int} values.  Classes
039         * implementing this interface are used to operate on a value when the
040         * type of that value is unknown at compile time.  When a visitor is
041         * passed to a value's {@link AnnotationValue#accept accept} method,
042         * the <tt>visit<i>XYZ</i></tt> method applicable to that value is
043         * invoked.
044         *
045         * <p> Classes implementing this interface may or may not throw a
046         * {@code NullPointerException} if the additional parameter {@code p}
047         * is {@code null}; see documentation of the implementing class for
048         * details.
049         * 
050         * <p> <b>WARNING:</b> It is possible that methods will be added to
051         * this interface to accommodate new, currently unknown, language
052         * structures added to future versions of the Java&trade; programming
053         * language.  Therefore, visitor classes directly implementing this
054         * interface may be source incompatible with future versions of the
055         * platform.  To avoid this source incompatibility, visitor
056         * implementations are encouraged to instead extend the appropriate
057         * abstract visitor class that implements this interface.  However, an
058         * API should generally use this visitor interface as the type for
059         * parameters, return type, etc. rather than one of the abstract
060         * classes.
061         *
062         * @param <R> the return type of this visitor's methods
063         * @param <P> the type of the additional parameter to this visitor's methods.
064         * @author Joseph D. Darcy
065         * @author Scott Seligman
066         * @author Peter von der Ah&eacute;
067         * @version 1.12 07/05/05
068         * @since 1.6
069         */
070        public interface AnnotationValueVisitor<R, P> {
071            /**
072             * Visits an annotation value.
073             * @param av the value to visit
074             * @param p a visitor-specified parameter
075             * @return  a visitor-specified result
076             */
077            R visit(AnnotationValue av, P p);
078
079            /**
080             * A convenience method equivalent to {@code v.visit(av, null)}.
081             * @param av the value to visit
082             * @return  a visitor-specified result
083             */
084            R visit(AnnotationValue av);
085
086            /**
087             * Visits a {@code boolean} value in an annotation.
088             * @param b the value being visited
089             * @param p a visitor-specified parameter
090             * @return the result of the visit
091             */
092            R visitBoolean(boolean b, P p);
093
094            /**
095             * Visits a {@code byte} value in an annotation.
096             * @param  b the value being visited
097             * @param  p a visitor-specified parameter
098             * @return the result of the visit
099             */
100            R visitByte(byte b, P p);
101
102            /**
103             * Visits a {@code char} value in an annotation.
104             * @param  c the value being visited
105             * @param  p a visitor-specified parameter
106             * @return the result of the visit
107             */
108            R visitChar(char c, P p);
109
110            /**
111             * Visits a {@code double} value in an annotation.
112             * @param  d the value being visited
113             * @param  p a visitor-specified parameter
114             * @return the result of the visit
115             */
116            R visitDouble(double d, P p);
117
118            /**
119             * Visits a {@code float} value in an annotation.
120             * @param  f the value being visited
121             * @param  p a visitor-specified parameter
122             * @return the result of the visit
123             */
124            R visitFloat(float f, P p);
125
126            /**
127             * Visits an {@code int} value in an annotation.
128             * @param  i the value being visited
129             * @param  p a visitor-specified parameter
130             * @return the result of the visit
131             */
132            R visitInt(int i, P p);
133
134            /**
135             * Visits a {@code long} value in an annotation.
136             * @param  i the value being visited
137             * @param  p a visitor-specified parameter
138             * @return the result of the visit
139             */
140            R visitLong(long i, P p);
141
142            /**
143             * Visits a {@code short} value in an annotation.
144             * @param  s the value being visited
145             * @param  p a visitor-specified parameter
146             * @return the result of the visit
147             */
148            R visitShort(short s, P p);
149
150            /**
151             * Visits a string value in an annotation.
152             * @param  s the value being visited
153             * @param  p a visitor-specified parameter
154             * @return the result of the visit
155             */
156            R visitString(String s, P p);
157
158            /**
159             * Visits a type value in an annotation.
160             * @param  t the value being visited
161             * @param  p a visitor-specified parameter
162             * @return the result of the visit
163             */
164            R visitType(TypeMirror t, P p);
165
166            /**
167             * Visits an {@code enum} value in an annotation.
168             * @param  c the value being visited
169             * @param  p a visitor-specified parameter
170             * @return the result of the visit
171             */
172            R visitEnumConstant(VariableElement c, P p);
173
174            /**
175             * Visits an annotation value in an annotation.
176             * @param  a the value being visited
177             * @param  p a visitor-specified parameter
178             * @return the result of the visit
179             */
180            R visitAnnotation(AnnotationMirror a, P p);
181
182            /**
183             * Visits an array value in an annotation.
184             * @param  vals the value being visited
185             * @param  p a visitor-specified parameter
186             * @return the result of the visit
187             */
188            R visitArray(List<? extends AnnotationValue> vals, P p);
189
190            /**
191             * Visits an unknown kind of annotation value.
192             * This can occur if the language evolves and new kinds
193             * of value can be stored in an annotation.
194             * @param  av the unknown value being visited
195             * @param  p a visitor-specified parameter
196             * @return the result of the visit
197             * @throws UnknownAnnotationValueException
198             *	a visitor implementation may optionally throw this exception
199             */
200            R visitUnknown(AnnotationValue av, P p);
201        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.