Source Code Cross Referenced for JavaWriterWrapper.java in  » EJB-Server-resin-3.1.5 » resin » com » caucho » java » gen » 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 » EJB Server resin 3.1.5 » resin » com.caucho.java.gen 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003:         *
004:         * This file is part of Resin(R) Open Source
005:         *
006:         * Each copy or derived work must preserve the copyright notice and this
007:         * notice unmodified.
008:         *
009:         * Resin Open Source is free software; you can redistribute it and/or modify
010:         * it under the terms of the GNU General Public License as published by
011:         * the Free Software Foundation; either version 2 of the License, or
012:         * (at your option) any later version.
013:         *
014:         * Resin Open Source is distributed in the hope that it will be useful,
015:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
016:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017:         * of NON-INFRINGEMENT.  See the GNU General Public License for more
018:         * details.
019:         *
020:         * You should have received a copy of the GNU General Public License
021:         * along with Resin Open Source; if not, write to the
022:         *
023:         *   Free Software Foundation, Inc.
024:         *   59 Temple Place, Suite 330
025:         *   Boston, MA 02111-1307  USA
026:         *
027:         * @author Scott Ferguson
028:         */
029:
030:        package com.caucho.java.gen;
031:
032:        import com.caucho.bytecode.JClass;
033:        import com.caucho.java.JavaWriter;
034:        import com.caucho.java.LineMap;
035:        import com.caucho.vfs.WriteStream;
036:
037:        import java.io.IOException;
038:
039:        /**
040:         * Wrapper
041:         */
042:        public class JavaWriterWrapper extends JavaWriter {
043:            // Write stream for generating the code
044:            private JavaWriter _writer;
045:
046:            public JavaWriterWrapper(JavaWriter writer) {
047:                super (null);
048:
049:                _writer = writer;
050:            }
051:
052:            /**
053:             * Returns the underlying stream.
054:             */
055:            public WriteStream getWriteStream() {
056:                return _writer.getWriteStream();
057:            }
058:
059:            /**
060:             * Returns the destination line.
061:             */
062:            public int getDestLine() {
063:                return _writer.getDestLine();
064:            }
065:
066:            /**
067:             * Sets the line map
068:             */
069:            public void setLineMap(LineMap lineMap) {
070:                _writer.setLineMap(lineMap);
071:            }
072:
073:            /**
074:             * Gets the line map
075:             */
076:            public LineMap getLineMap() {
077:                return _writer.getLineMap();
078:            }
079:
080:            /**
081:             * Sets the source filename and line.
082:             *
083:             * @param filename the filename of the source file.
084:             * @param line the line of the source file.
085:             */
086:            public void setLocation(String filename, int line)
087:                    throws IOException {
088:                _writer.setLocation(filename, line);
089:            }
090:
091:            /**
092:             * Generates a unique id.
093:             */
094:            public int generateId() {
095:                return _writer.generateId();
096:            }
097:
098:            /**
099:             * Prints a Java escaped string
100:             */
101:            public void printJavaString(String s) throws IOException {
102:                _writer.printJavaString(s);
103:            }
104:
105:            /**
106:             * Prints a Java escaped string surrounded by ", or null if the string is null.
107:             */
108:            public void printQuotedJavaString(String s) throws IOException {
109:                if (s == null)
110:                    _writer.print("null");
111:                else {
112:                    _writer.print("\"");
113:                    _writer.printJavaString(s);
114:                    _writer.print("\"");
115:                }
116:            }
117:
118:            /**
119:             * Prints a Java escaped string
120:             */
121:            public void printJavaChar(char ch) throws IOException {
122:                _writer.printJavaChar(ch);
123:            }
124:
125:            /**
126:             * Pushes an indentation depth.
127:             */
128:            public void pushDepth() throws IOException {
129:                _writer.pushDepth();
130:            }
131:
132:            /**
133:             * Pops an indentation depth.
134:             */
135:            public void popDepth() throws IOException {
136:                _writer.popDepth();
137:            }
138:
139:            /**
140:             * Prints a string
141:             */
142:            public void print(String s) throws IOException {
143:                _writer.print(s);
144:            }
145:
146:            /**
147:             * Prints a character.
148:             */
149:            public void print(char ch) throws IOException {
150:                _writer.print(ch);
151:            }
152:
153:            /**
154:             * Prints a boolean.
155:             */
156:            public void print(boolean b) throws IOException {
157:                _writer.print(b);
158:            }
159:
160:            /**
161:             * Prints an integer.
162:             */
163:            public void print(int i) throws IOException {
164:                _writer.print(i);
165:            }
166:
167:            /**
168:             * Prints an long
169:             */
170:            public void print(long l) throws IOException {
171:                _writer.print(l);
172:            }
173:
174:            /**
175:             * Prints an object.
176:             */
177:            public void print(Object o) throws IOException {
178:                _writer.print(o);
179:            }
180:
181:            /**
182:             * Prints a string with a new line
183:             */
184:            public void println(String s) throws IOException {
185:                _writer.println(s);
186:            }
187:
188:            /**
189:             * Prints a boolean with a new line
190:             */
191:            public void println(boolean v) throws IOException {
192:                _writer.println(v);
193:            }
194:
195:            /**
196:             * Prints a character.
197:             */
198:            public void println(char ch) throws IOException {
199:                _writer.println(ch);
200:            }
201:
202:            /**
203:             * Prints an integer with a new line
204:             */
205:            public void println(int v) throws IOException {
206:                _writer.println(v);
207:            }
208:
209:            /**
210:             * Prints an long with a new line
211:             */
212:            public void println(long v) throws IOException {
213:                _writer.println(v);
214:            }
215:
216:            /**
217:             * Prints an object with a new line
218:             */
219:            public void println(Object v) throws IOException {
220:                _writer.println(v);
221:            }
222:
223:            /**
224:             * Prints a newline
225:             */
226:            public void println() throws IOException {
227:                _writer.println();
228:            }
229:
230:            /**
231:             * Prints the Java represention of the class
232:             */
233:            public void printClass(Class cl) throws IOException {
234:                _writer.printClass(cl);
235:            }
236:
237:            /**
238:             * Converts a java primitive type to a Java object.
239:             *
240:             * @param value the java expression to be converted
241:             * @param javaType the type of the converted expression.
242:             */
243:            public void printJavaTypeToObject(String value, Class javaType)
244:                    throws IOException {
245:                _writer.printJavaTypeToObject(value, javaType);
246:            }
247:
248:            /**
249:             * Converts a java primitive type to a Java object.
250:             *
251:             * @param value the java expression to be converted
252:             * @param javaType the type of the converted expression.
253:             */
254:            public void printJavaTypeToObject(String value, JClass javaType)
255:                    throws IOException {
256:                _writer.printJavaTypeToObject(value, javaType);
257:            }
258:
259:            /**
260:             * Prints the indentation at the beginning of a line.
261:             */
262:            public void printIndent() throws IOException {
263:                _writer.printIndent();
264:            }
265:
266:            /**
267:             * Returns the error message with proper line number.
268:             */
269:            public String errorMessage(String message) {
270:                return _writer.errorMessage(message);
271:            }
272:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.