Source Code Cross Referenced for JavaDeclaration.java in  » Testing » KeY » de » uka » ilkd » key » java » 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 » Testing » KeY » de.uka.ilkd.key.java.declaration 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // This file is part of KeY - Integrated Deductive Software Design
002:        // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
003:        //                         Universitaet Koblenz-Landau, Germany
004:        //                         Chalmers University of Technology, Sweden
005:        //
006:        // The KeY system is protected by the GNU General Public License. 
007:        // See LICENSE.TXT for details.
008:        //
009:        //
010:
011:        package de.uka.ilkd.key.java.declaration;
012:
013:        import de.uka.ilkd.key.java.Declaration;
014:        import de.uka.ilkd.key.java.JavaNonTerminalProgramElement;
015:        import de.uka.ilkd.key.java.declaration.modifier.*;
016:        import de.uka.ilkd.key.util.ExtList;
017:
018:        /**
019:         *  Java declaration.
020:         * taken from COMPOST and changed to achieve an immutable structure
021:         */
022:
023:        public abstract class JavaDeclaration extends
024:                JavaNonTerminalProgramElement implements  Declaration {
025:
026:            /**
027:             * Modifiers.
028:             * caches the wrapper for the modifiers. The wrapper is needed to get access
029:             * to the array without hurting immutabilitiy */
030:            protected final ArrayOfModifier modArray;
031:
032:            /**
033:             *      Java declaration.
034:             */
035:            public JavaDeclaration() {
036:                modArray = null;
037:            }
038:
039:            public JavaDeclaration(Modifier[] mods) {
040:                modArray = new ArrayOfModifier(mods);
041:            }
042:
043:            public JavaDeclaration(ArrayOfModifier mods) {
044:                modArray = mods;
045:            }
046:
047:            /**
048:             * Constructor for the transformation of COMPOST ASTs to KeY.
049:             * @param children the children of this AST element as KeY classes. May
050:             * include: several Modifier (taken as modifiers of the declaration), 
051:             * a Comment
052:             */
053:            public JavaDeclaration(ExtList children) {
054:                super (children);
055:                modArray = new ArrayOfModifier((Modifier[]) children
056:                        .collect(Modifier.class));
057:            }
058:
059:            /**
060:             *      Get modifiers.
061:             *      @return the modifier array wrapper.
062:             */
063:
064:            public ArrayOfModifier getModifiers() {
065:                return modArray;
066:            }
067:
068:            /**
069:             *      Returns a Public, Protected, or Private Modifier, if there
070:             *      is one, null otherwise. A return value of null can usually be
071:             *      interpreted as package visibility.
072:             */
073:
074:            public VisibilityModifier getVisibilityModifier() {
075:                if (modArray == null) {
076:                    return null;
077:                }
078:                for (int i = modArray.size() - 1; i >= 0; i -= 1) {
079:                    Modifier m = modArray.getModifier(i);
080:                    if (m instanceof  VisibilityModifier) {
081:                        return (VisibilityModifier) m;
082:                    }
083:                }
084:                return null;
085:            }
086:
087:            private boolean containsModifier(Class type) {
088:                int s = (modArray == null) ? 0 : modArray.size();
089:                for (int i = 0; i < s; i += 1) {
090:                    if (type.isInstance(modArray.getModifier(i))) {
091:                        return true;
092:                    }
093:                }
094:                return false;
095:            }
096:
097:            /**
098:             * Test whether the declaration is abstract.
099:             */
100:            protected boolean isAbstract() {
101:                return containsModifier(Abstract.class);
102:            }
103:
104:            /**
105:             * Test whether the declaration is private.
106:             */
107:
108:            protected boolean isPrivate() {
109:                return containsModifier(Private.class);
110:            }
111:
112:            /**
113:             * Test whether the declaration is protected.
114:             */
115:
116:            protected boolean isProtected() {
117:                return containsModifier(Protected.class);
118:            }
119:
120:            /**
121:             * Test whether the declaration is public.
122:             */
123:
124:            protected boolean isPublic() {
125:                return containsModifier(Public.class);
126:            }
127:
128:            /**
129:             * Test whether the declaration is static.
130:             */
131:
132:            protected boolean isStatic() {
133:                return containsModifier(Static.class);
134:            }
135:
136:            /**
137:             * Test whether the declaration is transient.
138:             */
139:
140:            protected boolean isTransient() {
141:                return containsModifier(Transient.class);
142:            }
143:
144:            /**
145:             * Test whether the declaration is model (the jml modifier is meant).
146:             */
147:
148:            protected boolean isModel() {
149:                return containsModifier(Model.class);
150:            }
151:
152:            /**
153:             * Test whether the declaration is volatile.
154:             */
155:
156:            protected boolean isVolatile() {
157:                return containsModifier(Volatile.class);
158:            }
159:
160:            /**
161:             * Test whether the declaration is strictfp.
162:             */
163:
164:            protected boolean isStrictFp() {
165:                return containsModifier(StrictFp.class);
166:            }
167:
168:            /**
169:             * Test whether the declaration is final.
170:             */
171:
172:            protected boolean isFinal() {
173:                return containsModifier(Final.class);
174:            }
175:
176:            /**
177:             * Test whether the declaration is native.
178:             */
179:
180:            protected boolean isNative() {
181:                return containsModifier(Native.class);
182:            }
183:
184:            /**
185:             * Test whether the declaration is synchronized.
186:             */
187:
188:            protected boolean isSynchronized() {
189:                return containsModifier(Synchronized.class);
190:            }
191:
192:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.