Source Code Cross Referenced for Declaration.java in  » 6.0-JDK-Modules-com.sun » mirror » com » sun » mirror » declaration » Java Source Code / Java DocumentationJava Source Code and Java Documentation

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 geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules com.sun » mirror » com.sun.mirror.declaration 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004 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 com.sun.mirror.declaration;
027:
028:        import java.lang.annotation.Annotation;
029:        import java.util.Collection;
030:
031:        import com.sun.mirror.type.*;
032:        import com.sun.mirror.util.*;
033:
034:        /**
035:         * Represents the declaration of a program element such as a package,
036:         * class, or method.  Each declaration represents a static, language-level
037:         * construct (and not, for example, a runtime construct of the virtual
038:         * machine), and typically corresponds one-to-one with a particular
039:         * fragment of source code.
040:         *
041:         * <p> Declarations should be compared using the {@link #equals(Object)}
042:         * method.  There is no guarantee that any particular declaration will
043:         * always be represented by the same object.
044:         *
045:         * @author Joseph D. Darcy
046:         * @author Scott Seligman
047:         * @version 1.13 07/05/05
048:         *
049:         * @see Declarations
050:         * @see TypeMirror
051:         * @since 1.5
052:         */
053:
054:        public interface Declaration {
055:
056:            /**
057:             * Tests whether an object represents the same declaration as this.
058:             *
059:             * @param obj  the object to be compared with this declaration
060:             * @return <tt>true</tt> if the specified object represents the same
061:             *		declaration as this
062:             */
063:            boolean equals(Object obj);
064:
065:            /**
066:             * Returns the text of the documentation ("javadoc") comment of
067:             * this declaration.
068:             *
069:             * @return the documentation comment of this declaration, or <tt>null</tt>
070:             *		if there is none
071:             */
072:            String getDocComment();
073:
074:            /**
075:             * Returns the annotations that are directly present on this declaration.
076:             *
077:             * @return the annotations directly present on this declaration;
078:             *		an empty collection if there are none
079:             */
080:            Collection<AnnotationMirror> getAnnotationMirrors();
081:
082:            /**
083:             * Returns the annotation of this declaration having the specified
084:             * type.  The annotation may be either inherited or directly
085:             * present on this declaration.
086:             *
087:             * <p> The annotation returned by this method could contain an element
088:             * whose value is of type <tt>Class</tt>.
089:             * This value cannot be returned directly:  information necessary to
090:             * locate and load a class (such as the class loader to use) is
091:             * not available, and the class might not be loadable at all.
092:             * Attempting to read a <tt>Class</tt> object by invoking the relevant
093:             * method on the returned annotation
094:             * will result in a {@link MirroredTypeException},
095:             * from which the corresponding {@link TypeMirror} may be extracted.
096:             * Similarly, attempting to read a <tt>Class[]</tt>-valued element
097:             * will result in a {@link MirroredTypesException}.
098:             *
099:             * <blockquote>
100:             * <i>Note:</i> This method is unlike
101:             * others in this and related interfaces.  It operates on run-time
102:             * reflective information -- representations of annotation types
103:             * currently loaded into the VM -- rather than on the mirrored
104:             * representations defined by and used throughout these
105:             * interfaces.  It is intended for callers that are written to
106:             * operate on a known, fixed set of annotation types.
107:             * </blockquote>
108:             *
109:             * @param <A>  the annotation type
110:             * @param annotationType  the <tt>Class</tt> object corresponding to
111:             *		the annotation type
112:             * @return the annotation of this declaration having the specified type
113:             *
114:             * @see #getAnnotationMirrors()
115:             */
116:            <A extends Annotation> A getAnnotation(Class<A> annotationType);
117:
118:            /**
119:             * Returns the modifiers of this declaration, excluding annotations.
120:             * Implicit modifiers, such as the <tt>public</tt> and <tt>static</tt>
121:             * modifiers of interface members, are included.
122:             *
123:             * @return the modifiers of this declaration in undefined order;
124:             *		an empty collection if there are none
125:             */
126:            Collection<Modifier> getModifiers();
127:
128:            /**
129:             * Returns the simple (unqualified) name of this declaration.
130:             * The name of a generic type does not include any reference
131:             * to its formal type parameters.
132:             * For example, the simple name of the interface declaration
133:             * {@code java.util.Set<E>} is <tt>"Set"</tt>.
134:             * If this declaration represents the empty package, an empty
135:             * string is returned.
136:             * If it represents a constructor, the simple name of its
137:             * declaring class is returned.
138:             *
139:             * @return the simple name of this declaration
140:             */
141:            String getSimpleName();
142:
143:            /**
144:             * Returns the source position of the beginning of this declaration.
145:             * Returns <tt>null</tt> if the position is unknown or not applicable.
146:             *
147:             * <p> This source position is intended for use in providing
148:             * diagnostics, and indicates only approximately where a declaration
149:             * begins.
150:             *
151:             * @return the source position of the beginning of this declaration,
152:             *		or null if the position is unknown or not applicable
153:             */
154:            SourcePosition getPosition();
155:
156:            /**
157:             * Applies a visitor to this declaration.
158:             *
159:             * @param v the visitor operating on this declaration
160:             */
161:            void accept(DeclarationVisitor v);
162:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.