Source Code Cross Referenced for PropertyBuffer.java in  » Database-ORM » transformica-2.3.0 » biz » hammurapi » transformica » helpers » 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 ORM » transformica 2.3.0 » biz.hammurapi.transformica.helpers 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * transformica 2
003:         * Code generator 
004:         * Copyright (C) 2004  Hammurapi Group
005:         *
006:         * This program is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2 of the License, or (at your option) any later version.
010:         *
011:         * This program is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
019:         *
020:         * URL: http://www.pavelvlasov.com/pv/content/menu.show@id=products.transformica.html
021:         * e-Mail: support@hammurapi.biz
022:         */
023:        package biz.hammurapi.transformica.helpers;
024:
025:        import biz.hammurapi.config.ConfigurationException;
026:        import biz.hammurapi.config.Parameterizable;
027:        import biz.hammurapi.transformica.BaseContextObject;
028:        import biz.hammurapi.transformica.ContextObject;
029:        import biz.hammurapi.transformica.TransformicaException;
030:
031:        /**
032:         * Accumulates string and then sets Ant property to that string 
033:         * @author Pavel Vlasov
034:         * @version $Revision: 1.1 $
035:         */
036:        public class PropertyBuffer extends BaseContextObject implements 
037:                Parameterizable, ContextObject {
038:            private String propertyName;
039:            private StringBuffer buffer = new StringBuffer();
040:
041:            public PropertyBuffer() {
042:                super ();
043:            }
044:
045:            public PropertyBuffer(String initialValue) {
046:                super ();
047:                buffer.append(initialValue);
048:            }
049:
050:            public boolean setParameter(String name, Object parameter)
051:                    throws ConfigurationException {
052:                if ("property".equals(name)) {
053:                    propertyName = parameter.toString();
054:                } else {
055:                    throw new ConfigurationException("Parameter " + name
056:                            + " is not supported by "
057:                            + this .getClass().getName());
058:                }
059:                return true;
060:            }
061:
062:            public void destroy() throws TransformicaException {
063:                if (propertyName == null) {
064:                    throw new TransformicaException("Property name is not set");
065:                } else {
066:                    session.getTask().getProject().setProperty(propertyName,
067:                            buffer.toString());
068:                }
069:
070:                super .destroy();
071:            }
072:
073:            /**
074:             * @param b
075:             * @return
076:             */
077:            public synchronized StringBuffer append(boolean b) {
078:                session.debug("PropertyBuffer[" + propertyName + "].append("
079:                        + b + ")");
080:                return buffer.append(b);
081:            }
082:
083:            /**
084:             * @param c
085:             * @return
086:             */
087:            public synchronized StringBuffer append(char c) {
088:                session.debug("PropertyBuffer[" + propertyName + "].append("
089:                        + c + ")");
090:                return buffer.append(c);
091:            }
092:
093:            /**
094:             * @param str
095:             * @return
096:             */
097:            public synchronized StringBuffer append(char[] str) {
098:                session.debug("PropertyBuffer[" + propertyName + "].append("
099:                        + String.valueOf(str) + ")");
100:                return buffer.append(str);
101:            }
102:
103:            /**
104:             * @param str
105:             * @param offset
106:             * @param len
107:             * @return
108:             */
109:            public synchronized StringBuffer append(char[] str, int offset,
110:                    int len) {
111:                session.debug("PropertyBuffer[" + propertyName + "].append()");
112:                return buffer.append(str, offset, len);
113:            }
114:
115:            /**
116:             * @param d
117:             * @return
118:             */
119:            public synchronized StringBuffer append(double d) {
120:                session.debug("PropertyBuffer[" + propertyName + "].append("
121:                        + d + ")");
122:                return buffer.append(d);
123:            }
124:
125:            /**
126:             * @param f
127:             * @return
128:             */
129:            public synchronized StringBuffer append(float f) {
130:                session.debug("PropertyBuffer[" + propertyName + "].append("
131:                        + f + ")");
132:                return buffer.append(f);
133:            }
134:
135:            /**
136:             * @param i
137:             * @return
138:             */
139:            public synchronized StringBuffer append(int i) {
140:                session.debug("PropertyBuffer[" + propertyName + "].append("
141:                        + i + ")");
142:                return buffer.append(i);
143:            }
144:
145:            /**
146:             * @param obj
147:             * @return
148:             */
149:            public synchronized StringBuffer append(Object obj) {
150:                session.debug("PropertyBuffer[" + propertyName + "].append("
151:                        + obj + ")");
152:                return buffer.append(obj);
153:            }
154:
155:            /**
156:             * @param str
157:             * @return
158:             */
159:            public synchronized StringBuffer append(String str) {
160:                session.debug("PropertyBuffer[" + propertyName + "].append("
161:                        + str + ")");
162:                return buffer.append(str);
163:            }
164:
165:            /**
166:             * @param sb
167:             * @return
168:             */
169:            public synchronized StringBuffer append(StringBuffer sb) {
170:                session.debug("PropertyBuffer[" + propertyName + "].append("
171:                        + sb + ")");
172:                return buffer.append(sb);
173:            }
174:
175:            /**
176:             * @param l
177:             * @return
178:             */
179:            public synchronized StringBuffer append(long l) {
180:                session.debug("PropertyBuffer[" + propertyName + "].append("
181:                        + l + ")");
182:                return buffer.append(l);
183:            }
184:
185:            /**
186:             * @param offset
187:             * @param b
188:             * @return
189:             */
190:            public StringBuffer insert(int offset, boolean b) {
191:                session.debug("PropertyBuffer[" + propertyName + "].insert("
192:                        + offset + "," + b + ")");
193:                return buffer.insert(offset, b);
194:            }
195:
196:            /**
197:             * @param offset
198:             * @param c
199:             * @return
200:             */
201:            public synchronized StringBuffer insert(int offset, char c) {
202:                session.debug("PropertyBuffer[" + propertyName + "].insert("
203:                        + offset + "," + c + ")");
204:                return buffer.insert(offset, c);
205:            }
206:
207:            /**
208:             * @param offset
209:             * @param str
210:             * @return
211:             */
212:            public synchronized StringBuffer insert(int offset, char[] str) {
213:                session.debug("PropertyBuffer[" + propertyName + "].insert("
214:                        + offset + "," + String.valueOf(str) + ")");
215:                return buffer.insert(offset, str);
216:            }
217:
218:            /**
219:             * @param index
220:             * @param str
221:             * @param offset
222:             * @param len
223:             * @return
224:             */
225:            public synchronized StringBuffer insert(int index, char[] str,
226:                    int offset, int len) {
227:                session.debug("PropertyBuffer[" + propertyName + "].insert("
228:                        + offset + ",...)");
229:                return buffer.insert(index, str, offset, len);
230:            }
231:
232:            /**
233:             * @param offset
234:             * @param d
235:             * @return
236:             */
237:            public StringBuffer insert(int offset, double d) {
238:                session.debug("PropertyBuffer[" + propertyName + "].insert("
239:                        + offset + "," + d + ")");
240:                return buffer.insert(offset, d);
241:            }
242:
243:            /**
244:             * @param offset
245:             * @param f
246:             * @return
247:             */
248:            public StringBuffer insert(int offset, float f) {
249:                session.debug("PropertyBuffer[" + propertyName + "].insert("
250:                        + offset + "," + f + ")");
251:                return buffer.insert(offset, f);
252:            }
253:
254:            /**
255:             * @param offset
256:             * @param i
257:             * @return
258:             */
259:            public StringBuffer insert(int offset, int i) {
260:                session.debug("PropertyBuffer[" + propertyName + "].insert("
261:                        + offset + "," + i + ")");
262:                return buffer.insert(offset, i);
263:            }
264:
265:            /**
266:             * @param offset
267:             * @param obj
268:             * @return
269:             */
270:            public synchronized StringBuffer insert(int offset, Object obj) {
271:                session.debug("PropertyBuffer[" + propertyName + "].insert("
272:                        + offset + "," + obj + ")");
273:                return buffer.insert(offset, obj);
274:            }
275:
276:            /**
277:             * @param offset
278:             * @param str
279:             * @return
280:             */
281:            public synchronized StringBuffer insert(int offset, String str) {
282:                session.debug("PropertyBuffer[" + propertyName + "].insert("
283:                        + offset + "," + str + ")");
284:                return buffer.insert(offset, str);
285:            }
286:
287:            /**
288:             * @param offset
289:             * @param l
290:             * @return
291:             */
292:            public StringBuffer insert(int offset, long l) {
293:                session.debug("PropertyBuffer[" + propertyName + "].insert("
294:                        + offset + "," + l + ")");
295:                return buffer.insert(offset, l);
296:            }
297:
298:            /**
299:             * @return
300:             */
301:            StringBuffer getBuffer() {
302:                return buffer;
303:            }
304:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.