Source Code Cross Referenced for CodeHelperInElementDto.java in  » J2EE » Jaffa » org » jaffa » components » codehelper » dto » 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 » J2EE » Jaffa » org.jaffa.components.codehelper.dto 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ====================================================================
003:         * JAFFA - Java Application Framework For All
004:         *
005:         * Copyright (C) 2002 JAFFA Development Group
006:         *
007:         *     This library is free software; you can redistribute it and/or
008:         *     modify it under the terms of the GNU Lesser General Public
009:         *     License as published by the Free Software Foundation; either
010:         *     version 2.1 of the License, or (at your option) any later version.
011:         *
012:         *     This library is distributed in the hope that it will be useful,
013:         *     but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015:         *     Lesser General Public License for more details.
016:         *
017:         *     You should have received a copy of the GNU Lesser General Public
018:         *     License along with this library; if not, write to the Free Software
019:         *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
020:         *
021:         * Redistribution and use of this software and associated documentation ("Software"),
022:         * with or without modification, are permitted provided that the following conditions are met:
023:         * 1.	Redistributions of source code must retain copyright statements and notices.
024:         *         Redistributions must also contain a copy of this document.
025:         * 2.	Redistributions in binary form must reproduce the above copyright notice,
026:         * 	this list of conditions and the following disclaimer in the documentation
027:         * 	and/or other materials provided with the distribution.
028:         * 3.	The name "JAFFA" must not be used to endorse or promote products derived from
029:         * 	this Software without prior written permission. For written permission,
030:         * 	please contact mail to: jaffagroup@yahoo.com.
031:         * 4.	Products derived from this Software may not be called "JAFFA" nor may "JAFFA"
032:         * 	appear in their names without prior written permission.
033:         * 5.	Due credit should be given to the JAFFA Project (http://jaffa.sourceforge.net).
034:         *
035:         * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
036:         * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
037:         * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
038:         * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
039:         * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
040:         * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
041:         * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
042:         * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
043:         * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
044:         * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
045:         * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
046:         * SUCH DAMAGE.
047:         * ====================================================================
048:         */
049:
050:        package org.jaffa.components.codehelper.dto;
051:
052:        import java.util.*;
053:
054:        /** The input to the ICodeHelper, will consist of a List of instances of this class.
055:         * The ICodeHelper will query the 'domainClassName' and use reflection to determine the fields to return.
056:         * Additional criteria can be specified using instances of CriteriaElementDto.
057:         * The properties domainClassName, codeFieldName and the descriptionFieldName are mandatory, for the ICodeHelper to work correctly.
058:         *
059:         * @author  GautamJ
060:         */
061:        public class CodeHelperInElementDto {
062:
063:            /** Holds value of property code. */
064:            private String code;
065:
066:            /** Holds value of property domainClassName. */
067:            private String domainClassName;
068:
069:            /** Holds value of property codeFieldName. */
070:            private String codeFieldName;
071:
072:            /** Holds value of property descriptionFieldName. */
073:            private String descriptionFieldName;
074:
075:            /** Holds value of property criteriaFields. */
076:            private List criteriaFields;
077:
078:            /** Holds value of property appendCodeAndDescription. */
079:            private boolean appendCodeAndDescription;
080:
081:            /** Holds value of property appendBeginMarker. */
082:            private String appendBeginMarker;
083:
084:            /** Holds value of property appendEndMarker. */
085:            private String appendEndMarker;
086:
087:            /** Creates new CodeHelperInElementDto */
088:            public CodeHelperInElementDto() {
089:            }
090:
091:            /** Getter for property code.
092:             * @return Value of property code.
093:             */
094:            public String getCode() {
095:                return code;
096:            }
097:
098:            /** Setter for property code.
099:             * @param code New value of property code.
100:             */
101:            public void setCode(String code) {
102:                this .code = code;
103:            }
104:
105:            /** Getter for property domainClassName.
106:             * @return Value of property domainClassName.
107:             */
108:            public String getDomainClassName() {
109:                return domainClassName;
110:            }
111:
112:            /** Setter for property domainClassName.
113:             * @param domainClassName New value of property domainClassName.
114:             */
115:            public void setDomainClassName(String domainClassName) {
116:                this .domainClassName = domainClassName;
117:            }
118:
119:            /** Getter for property codeFieldName.
120:             * @return Value of property codeFieldName.
121:             */
122:            public String getCodeFieldName() {
123:                return codeFieldName;
124:            }
125:
126:            /** Setter for property codeFieldName.
127:             * @param codeFieldName New value of property codeFieldName.
128:             */
129:            public void setCodeFieldName(String codeFieldName) {
130:                this .codeFieldName = codeFieldName;
131:            }
132:
133:            /** Getter for property descriptionFieldName.
134:             * @return Value of property descriptionFieldName.
135:             */
136:            public String getDescriptionFieldName() {
137:                return descriptionFieldName;
138:            }
139:
140:            /** Setter for property descriptionFieldName.
141:             * @param descriptionFieldName New value of property descriptionFieldName.
142:             */
143:            public void setDescriptionFieldName(String descriptionFieldName) {
144:                this .descriptionFieldName = descriptionFieldName;
145:            }
146:
147:            /** Add a criteriaField to the list
148:             * @param criteriaField A criteriaField
149:             */
150:            public void addCriteriaField(CriteriaElementDto criteriaField) {
151:                if (criteriaFields == null)
152:                    criteriaFields = new ArrayList();
153:                criteriaFields.add(criteriaField);
154:            }
155:
156:            /** Add a criteriaField at the specified position in the list
157:             * @param criteriaField A criteriaField
158:             * @param index The position in the list
159:             */
160:            public void setCriteriaField(CriteriaElementDto criteriaField,
161:                    int index) {
162:                if (criteriaFields == null)
163:                    criteriaFields = new ArrayList();
164:
165:                //-- check bounds for index
166:                if (index < 0 || index > criteriaFields.size())
167:                    throw new IndexOutOfBoundsException();
168:
169:                criteriaFields.set(index, criteriaField);
170:            }
171:
172:            /** Recreate the internal list with the input array of criteriaField
173:             * @param criteriaFields An array of criteriaField
174:             */
175:            public void setCriteriaFields(CriteriaElementDto[] criteriaFields) {
176:                this .criteriaFields = Arrays.asList(criteriaFields);
177:            }
178:
179:            /** Clear the list of criteriaField
180:             */
181:            public void clearCriteriaFields() {
182:                if (criteriaFields != null)
183:                    criteriaFields.clear();
184:            }
185:
186:            /** Remove a criteriaField from the list
187:             * @param criteriaField The criteriaField to be removed
188:             * @return true if this list contained the specified element
189:             */
190:            public boolean removeCriteriaField(CriteriaElementDto criteriaField) {
191:                if (criteriaFields != null)
192:                    return criteriaFields.remove(criteriaField);
193:                else
194:                    return false;
195:            }
196:
197:            /** Return a criteriaField at the specified position in the list
198:             * @param index The position in the list
199:             * @return The criteriaField
200:             */
201:            public CriteriaElementDto getCriteriaField(int index) {
202:                //-- check bounds for index
203:                if (criteriaFields == null || index < 0
204:                        || index > criteriaFields.size())
205:                    throw new IndexOutOfBoundsException();
206:
207:                return (CriteriaElementDto) criteriaFields.get(index);
208:            }
209:
210:            /** Returns an array of criteriaField
211:             * @return An array of criteriaField
212:             */
213:            public CriteriaElementDto[] getCriteriaFields() {
214:                if (criteriaFields != null)
215:                    return (CriteriaElementDto[]) criteriaFields
216:                            .toArray(new CriteriaElementDto[0]);
217:                else
218:                    return null;
219:            }
220:
221:            /** Returns the number of criteriaField in the list
222:             * @return The number of criteriaField in the list
223:             */
224:            public int getCriteriaFieldCount() {
225:                if (criteriaFields != null)
226:                    return criteriaFields.size();
227:                else
228:                    return 0;
229:            }
230:
231:            /** Getter for property appendCodeAndDescription.
232:             * @return Value of property appendCodeAndDescription.
233:             */
234:            public boolean isAppendCodeAndDescription() {
235:                return this .appendCodeAndDescription;
236:            }
237:
238:            /** Setter for property appendCodeAndDescription.
239:             * @param appendCodeAndDescription New value of property appendCodeAndDescription.
240:             */
241:            public void setAppendCodeAndDescription(
242:                    boolean appendCodeAndDescription) {
243:                this .appendCodeAndDescription = appendCodeAndDescription;
244:            }
245:
246:            /** Getter for property appendBeginMarker.
247:             * @return Value of property appendBeginMarker.
248:             */
249:            public String getAppendBeginMarker() {
250:                return this .appendBeginMarker;
251:            }
252:
253:            /** Setter for property appendBeginMarker.
254:             * @param appendBeginMarker New value of property appendBeginMarker.
255:             */
256:            public void setAppendBeginMarker(String appendBeginMarker) {
257:                this .appendBeginMarker = appendBeginMarker;
258:            }
259:
260:            /** Getter for property appendEndMarker.
261:             * @return Value of property appendEndMarker.
262:             */
263:            public String getAppendEndMarker() {
264:                return this .appendEndMarker;
265:            }
266:
267:            /** Setter for property appendEndMarker.
268:             * @param appendEndMarker New value of property appendEndMarker.
269:             */
270:            public void setAppendEndMarker(String appendEndMarker) {
271:                this .appendEndMarker = appendEndMarker;
272:            }
273:
274:            /** Returns diagnostic information.
275:             * @return diagnostic information.
276:             */
277:            public String toString() {
278:                StringBuffer buf = new StringBuffer();
279:                buf.append("<CodeHelperInElementDto>");
280:                buf.append("<code>");
281:                if (code != null)
282:                    buf.append(code);
283:                buf.append("</code>");
284:                buf.append("<domainClassName>");
285:                if (domainClassName != null)
286:                    buf.append(domainClassName);
287:                buf.append("</domainClassName>");
288:                buf.append("<codeFieldName>");
289:                if (codeFieldName != null)
290:                    buf.append(codeFieldName);
291:                buf.append("</codeFieldName>");
292:                buf.append("<descriptionFieldName>");
293:                if (descriptionFieldName != null)
294:                    buf.append(descriptionFieldName);
295:                buf.append("</descriptionFieldName>");
296:                buf.append("<appendCodeAndDescription>");
297:                buf.append(appendCodeAndDescription);
298:                buf.append("</appendCodeAndDescription>");
299:                buf.append("<appendBeginMarker>");
300:                if (appendBeginMarker != null)
301:                    buf.append(appendBeginMarker);
302:                buf.append("</appendBeginMarker>");
303:                buf.append("<appendEndMarker>");
304:                if (appendEndMarker != null)
305:                    buf.append(appendEndMarker);
306:                buf.append("</appendEndMarker>");
307:
308:                buf.append("<criteriaFields>");
309:                if (criteriaFields != null) {
310:                    for (Iterator i = criteriaFields.iterator(); i.hasNext();)
311:                        buf.append(i.next());
312:                }
313:                buf.append("</criteriaFields>");
314:
315:                buf.append("</CodeHelperInElementDto>");
316:                return buf.toString();
317:            }
318:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.