Source Code Cross Referenced for Annotation.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » core » dom » 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 » IDE Eclipse » jdt » org.eclipse.jdt.core.dom 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2004, 2006 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.jdt.core.dom;
011:
012:        /**
013:         * Abstract base class of AST nodes that represent annotations.
014:         * <p>
015:         * <pre>
016:         * Annotation:
017:         *		NormalAnnotation
018:         *		MarkerAnnotation
019:         *		SingleMemberAnnotation
020:         * </pre>
021:         * </p>
022:         * @since 3.1
023:         */
024:        public abstract class Annotation extends Expression implements 
025:                IExtendedModifier {
026:
027:            /**
028:             * Returns structural property descriptor for the "typeName" property
029:             * of this node.
030:             * 
031:             * @return the property descriptor
032:             */
033:            abstract ChildPropertyDescriptor internalTypeNameProperty();
034:
035:            /**
036:             * Returns structural property descriptor for the "typeName" property
037:             * of this node.
038:             * 
039:             * @return the property descriptor
040:             */
041:            public final ChildPropertyDescriptor getTypeNameProperty() {
042:                return internalTypeNameProperty();
043:            }
044:
045:            /**
046:             * Creates and returns a structural property descriptor for the
047:             * "typeName" property declared on the given concrete node type.
048:             * 
049:             * @return the property descriptor
050:             */
051:            static final ChildPropertyDescriptor internalTypeNamePropertyFactory(
052:                    Class nodeClass) {
053:                return new ChildPropertyDescriptor(nodeClass,
054:                        "typeName", Name.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$
055:            }
056:
057:            /**
058:             * The annotation type name; lazily initialized; defaults to an unspecified,
059:             * legal Java identifier.
060:             */
061:            Name typeName = null;
062:
063:            /**
064:             * Creates a new AST node for an annotation node owned by the 
065:             * given AST.
066:             * <p>
067:             * N.B. This constructor is package-private.
068:             * </p>
069:             * 
070:             * @param ast the AST that is to own this node
071:             */
072:            Annotation(AST ast) {
073:                super (ast);
074:            }
075:
076:            /**
077:             * @see IExtendedModifier#isModifier()
078:             */
079:            public boolean isModifier() {
080:                return false;
081:            }
082:
083:            /**
084:             * @see IExtendedModifier#isAnnotation()
085:             */
086:            public boolean isAnnotation() {
087:                return true;
088:            }
089:
090:            /**
091:             * Returns the annotation type name of this annotation.
092:             * 
093:             * @return the annotation type name
094:             */
095:            public Name getTypeName() {
096:                if (this .typeName == null) {
097:                    // lazy init must be thread-safe for readers
098:                    synchronized (this ) {
099:                        if (this .typeName == null) {
100:                            preLazyInit();
101:                            this .typeName = new SimpleName(this .ast);
102:                            postLazyInit(this .typeName,
103:                                    internalTypeNameProperty());
104:                        }
105:                    }
106:                }
107:                return this .typeName;
108:            }
109:
110:            /**
111:             * Sets the annotation type name of this annotation.
112:             * 
113:             * @param typeName the annotation type name
114:             * @exception IllegalArgumentException if:
115:             * <ul>
116:             * <li>the node belongs to a different AST</li>
117:             * <li>the node already has a parent</li>
118:             * </ul>
119:             */
120:            public void setTypeName(Name typeName) {
121:                if (typeName == null) {
122:                    throw new IllegalArgumentException();
123:                }
124:                ChildPropertyDescriptor p = internalTypeNameProperty();
125:                ASTNode oldChild = this .typeName;
126:                preReplaceChild(oldChild, typeName, p);
127:                this .typeName = typeName;
128:                postReplaceChild(oldChild, typeName, p);
129:            }
130:
131:            /**
132:             * Returns whether this is a normal annotation
133:             * ({@link NormalAnnotation}).
134:             * 
135:             * @return <code>true</code> if this is a normal annotation,
136:             *    and <code>false</code> otherwise
137:             */
138:            public boolean isNormalAnnotation() {
139:                return (this  instanceof  NormalAnnotation);
140:            }
141:
142:            /**
143:             * Returns whether this is a marker annotation
144:             * ({@link MarkerAnnotation}).
145:             * 
146:             * @return <code>true</code> if this is a marker annotation,
147:             *    and <code>false</code> otherwise
148:             */
149:            public boolean isMarkerAnnotation() {
150:                return (this  instanceof  MarkerAnnotation);
151:            }
152:
153:            /**
154:             * Returns whether this is a single member annotation.
155:             * ({@link SingleMemberAnnotation}).
156:             * 
157:             * @return <code>true</code> if this is a single member annotation,
158:             *    and <code>false</code> otherwise
159:             */
160:            public boolean isSingleMemberAnnotation() {
161:                return (this  instanceof  SingleMemberAnnotation);
162:            }
163:
164:            /* (omit javadoc for this method)
165:             * Method declared on ASTNode.
166:             */
167:            int memSize() {
168:                return BASE_NODE_SIZE + 1 * 4;
169:            }
170:
171:            /**
172:             * Resolves and returns the resolved annotation for this annotation.
173:             * <p>
174:             * Note that bindings (which includes resolved annotations) are generally unavailable unless
175:             * requested when the AST is being built.
176:             * </p>
177:             * 
178:             * @return the resolved annotation, or <code>null</code> if the annotation cannot be resolved
179:             * @since 3.2
180:             */
181:            public IAnnotationBinding resolveAnnotationBinding() {
182:                return this.ast.getBindingResolver().resolveAnnotation(this);
183:            }
184:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.