Source Code Cross Referenced for TemplateConfigParameter.java in  » J2EE » jag » com » finalist » jaggenerator » template » 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 » jag » com.finalist.jaggenerator.template 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*   Copyright (C) 2003 Finalist IT Group
002:         *
003:         *   This file is part of JAG - the Java J2EE Application Generator
004:         *
005:         *   JAG is free software; you can redistribute it and/or modify
006:         *   it under the terms of the GNU General Public License as published by
007:         *   the Free Software Foundation; either version 2 of the License, or
008:         *   (at your option) any later version.
009:         *   JAG is distributed in the hope that it will be useful,
010:         *   but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:         *   GNU General Public License for more details.
013:         *   You should have received a copy of the GNU General Public License
014:         *   along with JAG; if not, write to the Free Software
015:         *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
016:         */
017:        package com.finalist.jaggenerator.template;
018:
019:        import java.util.HashMap;
020:
021:        /**
022:         * This bean represents a single configurable parameter,
023:         * as specified in a template's "template.xml".
024:         * 
025:         * @author Michael O'Connor - Finalist IT Group
026:         */
027:        public class TemplateConfigParameter {
028:
029:            /**
030:             * The 'type' value for a parameter whose value is determined by entering text into an input field.
031:             */
032:            public static final Type TYPE_TEXT = new Type("text");
033:            /**
034:             * The 'type' value for a parameter whose value is determined by clicking an on/off checkbox.
035:             */
036:            public static final Type TYPE_CHECKBOX = new Type("checkbox");
037:            /**
038:             * The 'type' value for a parameter whose value is determined by selecting an item from a predefined list.
039:             */
040:            public static final Type TYPE_LIST = new Type("list");
041:            /**
042:             * The 'type' value for a parameter whose value is determined by either:
043:             * <li>selecting an item from a predefined list, or </li>
044:             * <li>typing in a 'free text' value</li>
045:             */
046:            public static final Type TYPE_EDITABLE_LIST = new Type(
047:                    "list-editable");
048:
049:            private static final HashMap types = new HashMap();
050:            static {
051:                types.put(TYPE_TEXT.toString(), TYPE_TEXT);
052:                types.put(TYPE_CHECKBOX.toString(), TYPE_CHECKBOX);
053:                types.put(TYPE_LIST.toString(), TYPE_LIST);
054:                types.put(TYPE_EDITABLE_LIST.toString(), TYPE_EDITABLE_LIST);
055:            }
056:
057:            private String id;
058:            private String name;
059:            private String description;
060:            private Type type;
061:            private String[] presetValues;
062:            private String value;
063:
064:            /**
065:             * Gets the id - the unique identifier of this parameter used to access the parameter value
066:             * from the templates.
067:             *
068:             * @return id
069:             */
070:            public String getId() {
071:                return id;
072:            }
073:
074:            /**
075:             * Sets the id - the unique identifier of this parameter used to access the parameter value
076:             * from the templates.  This value should be a String following the same naming conventions
077:             * as a Java bean attribute (e.g. no spaces, hyphens, etc.).
078:             *
079:             * @param id
080:             */
081:            public void setId(String id) {
082:                this .id = id;
083:            }
084:
085:            /**
086:             * Gets the name - this is the human-readable short name used to represent this parameter in the GUI.
087:             *
088:             * @return
089:             */
090:            public String getName() {
091:                return name;
092:            }
093:
094:            /**
095:             * Sets the name - this is the human-readable short name used to represent this parameter in the GUI.
096:             *
097:             * @param name
098:             */
099:            public void setName(String name) {
100:                this .name = name;
101:            }
102:
103:            /**
104:             * Gets the description for this parameter - shows up in the GUI as a tooltip.
105:             *
106:             * @return
107:             */
108:            public String getDescription() {
109:                return description;
110:            }
111:
112:            /**
113:             * Sets the description for this parameter - shows up in the GUI as a tooltip.
114:             *
115:             * @param description
116:             */
117:            public void setDescription(String description) {
118:                this .description = description;
119:            }
120:
121:            /**
122:             * Gets the type of this configuration parameter.
123:             *
124:             * @return one of the TYPE_XXX constants defined in this class.
125:             */
126:            public TemplateConfigParameter.Type getType() {
127:                return type;
128:            }
129:
130:            /**
131:             * Sets the type of this configuration parameter.
132:             *
133:             * @param type - Use one of the TYPE_XXX constants defined in this class.
134:             */
135:            public void setType(TemplateConfigParameter.Type type) {
136:                this .type = type;
137:            }
138:
139:            /**
140:             * Gets the preset values for this parameter.
141:             * 
142:             * @return a String[] (may have length zero, never <code>null</code>).
143:             */
144:            public String[] getPresetValues() {
145:                return presetValues;
146:            }
147:
148:            public void setPresetValues(String[] presetValues) {
149:                this .presetValues = presetValues;
150:            }
151:
152:            public String getValue() {
153:                return value;
154:            }
155:
156:            public void setValue(String value) {
157:                this .value = value;
158:            }
159:
160:            /**
161:             * Translates a type's name into the corresponding Type object.
162:             *
163:             * @param name
164:             * @return <code>null</code> if the name is not a valid Type.
165:             */
166:            public static Type getTypeByName(String name) {
167:                return (Type) types.get(name);
168:            }
169:
170:            /** Objects of this class are used to determine a TemplateConfigParamater's type */
171:            private final static class Type {
172:                private String type;
173:
174:                private Type(String type) {
175:                    this .type = type;
176:                }
177:
178:                public String toString() {
179:                    return type;
180:                }
181:            }
182:
183:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.