Source Code Cross Referenced for ClassBuilder.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » services » compiler » 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 » Database DBMS » db derby 10.2 » org.apache.derby.iapi.services.compiler 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:           Derby - Class org.apache.derby.iapi.services.compiler.ClassBuilder
004:
005:           Licensed to the Apache Software Foundation (ASF) under one or more
006:           contributor license agreements.  See the NOTICE file distributed with
007:           this work for additional information regarding copyright ownership.
008:           The ASF licenses this file to you under the Apache License, Version 2.0
009:           (the "License"); you may not use this file except in compliance with
010:           the License.  You may obtain a copy of the License at
011:
012:              http://www.apache.org/licenses/LICENSE-2.0
013:
014:           Unless required by applicable law or agreed to in writing, software
015:           distributed under the License is distributed on an "AS IS" BASIS,
016:           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:           See the License for the specific language governing permissions and
018:           limitations under the License.
019:
020:         */
021:
022:        package org.apache.derby.iapi.services.compiler;
023:
024:        import org.apache.derby.iapi.services.loader.GeneratedClass;
025:        import org.apache.derby.iapi.error.StandardException;
026:        import org.apache.derby.iapi.util.ByteArray;
027:
028:        /**
029:         * ClassBuilder is used to construct a java class's byte array
030:         * representation.
031:         *
032:         * Limitations:
033:         *   No checking for language use violations such as invalid modifiers
034:         *	or duplicate field names.
035:         *   All classes must have a superclass; java.lang.Object must be
036:         *      supplied if there is no superclass.
037:         *
038:         * <p>
039:         * When a class is first created, it has:
040:         * <ul>
041:         * <li> a superclass
042:         * <li> modifiers
043:         * <li> a name
044:         * <li> a package
045:         * <li> no superinterfaces, methods, fields, or constructors
046:         * <li> an empty static initializer
047:         * </ul>
048:         * <p>
049:         * MethodBuilder implementations are required to get code out of the
050:         * constructs within their bodies in some manner. 
051:         * Most typically, they may have a stream to which the statement and 
052:         * expression constructs write the code that they represent,
053:         * and they walk over the statements and expressions in the appropriate order.
054:         *
055:         * @author ames
056:         */
057:        public interface ClassBuilder {
058:
059:            /**
060:             * add a field to this class. Fields cannot
061:             * be initialized here, they must be initialized
062:             * in the static initializer code (static fields)
063:             * or in the constructors.
064:             * <p>
065:             * Methods are added when they are created with the JavaFactory.
066:             * @param type	The type of the field in java language.
067:             * @param name	The name of the field.
068:             * @param modifiers	The | of the modifier values such as
069:             *					public, static, etc.
070:             * @see ClassBuilder#newMethodBuilder
071:             * @see #newConstructorBuilder
072:             */
073:            LocalField addField(String type, String name, int modifiers);
074:
075:            /**
076:            	Fully create the bytecode and load the
077:            	class using the ClassBuilder's ClassFactory.
078:
079:            	@exception StandardException Standard Cloudscape policy
080:             */
081:            GeneratedClass getGeneratedClass() throws StandardException;
082:
083:            /**
084:             * At the time the class is completed and bytecode
085:             * generated, if there are no constructors then
086:             * the default no-arg constructor will be defined.
087:             */
088:            ByteArray getClassBytecode() throws StandardException;
089:
090:            /**
091:             * the class's unqualified name
092:             */
093:            String getName();
094:
095:            /**
096:             * the class's qualified name
097:             */
098:            String getFullName();
099:
100:            /**
101:             * a method. Once it is created, parameters, thrown
102:             * exceptions, statements, and local variable declarations
103:             * must be added to it. It is put into its defining class
104:             * when it is created.
105:             * <verbatim>
106:               Java: #modifiers #returnType #methodName() {}
107:              		// modifiers is the | of the JVM constants for
108:              		// the modifiers such as static, public, etc.
109:               </verbatim>
110:               <p>
111:             * This is used to start a constructor as well; pass in
112:             * null for the returnType when used in that manner.
113:             *
114:             * @param modifiers the | of the Modifier
115:             *	constants representing the visibility and control of this
116:             *	method.
117:             * @param returnType the return type of the method as its
118:             *	Java language type name.
119:             * @param methodName the name of the method.
120:             *
121:             * @return the method builder.
122:             * @see java.lang.reflect.Modifier
123:             */
124:            MethodBuilder newMethodBuilder(int modifiers, String returnType,
125:                    String methodName);
126:
127:            /**
128:             * a method with parameters. Once it is created, thrown
129:             * exceptions, statements, and local variable declarations
130:             * must be added to it. It is put into its defining class
131:             * when it is created.
132:             * <verbatim>
133:               Java: #modifiers #returnType #methodName() {}
134:              		// modifiers is the | of the JVM constants for
135:              		// the modifiers such as static, public, etc.
136:               </verbatim>
137:               <p>
138:             * This is used to start a constructor as well; pass in
139:             * null for the returnType when used in that manner.
140:             *
141:             * @param modifiers the | of the Modifier
142:             *	constants representing the visibility and control of this
143:             *	method.
144:             * @param returnType the return type of the method as its
145:             *	Java language type name.
146:             * @param methodName the name of the method.
147:             * @param parms	an array of String representing the
148:             *				method's parameter types
149:             *
150:             * @return the method builder.
151:             * @see java.lang.reflect.Modifier
152:             */
153:            MethodBuilder newMethodBuilder(int modifiers, String returnType,
154:                    String methodName, String[] parms);
155:
156:            /**
157:             * a constructor. Once it is created, parameters, thrown
158:             * exceptions, statements, and local variable declarations
159:             * must be added to it. It is put into its defining class
160:             * when it is created.
161:             * <verbatim>
162:               Java: #modifiers #className() {}
163:              		// modifiers is the | of the JVM constants for
164:              		// the modifiers such as static, public, etc.
165:              		// className is taken from definingClass.name()
166:               </verbatim>
167:             * <p>
168:             * This is used to start a constructor as well; pass in
169:             * null for the returnType when used in that manner.
170:             *
171:             * @param modifiers the | of the Modifier
172:             *	constants representing the visibility and control of this
173:             *	method.
174:             *
175:             * @return the method builder for the constructor.
176:             * @see java.lang.reflect.Modifier
177:             */
178:            MethodBuilder newConstructorBuilder(int modifiers);
179:
180:            /**
181:            	Create a new private field and its getter and setter methods.
182:
183:            	@param getter getter for field
184:            	@param setter setter for field
185:            	@param methodModifier modifier for method
186:            	@param staticField true if the field is static
187:            	@param type type of the field, return type of the get method and
188:            	parameter type of the set method.
189:
190:             */
191:            void newFieldWithAccessors(String getter, String setter,
192:                    int methodModifier, boolean staticField, String type);
193:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.