Source Code Cross Referenced for ProductDO.java in  » Development » ivatamasks » com » ivata » mask » web » demo » product » 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 » Development » ivatamasks » com.ivata.mask.web.demo.product 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2001 - 2005 ivata limited.
003:         * All rights reserved.
004:         * -----------------------------------------------------------------------------
005:         * ivata masks may be redistributed under the GNU General Public
006:         * License as published by the Free Software Foundation;
007:         * version 2 of the License.
008:         *
009:         * These programs are free software; you can redistribute them and/or
010:         * modify them under the terms of the GNU General Public License
011:         * as published by the Free Software Foundation; version 2 of the License.
012:         *
013:         * These programs are distributed in the hope that they will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016:         *
017:         * See the GNU General Public License in the file LICENSE.txt for more
018:         * details.
019:         *
020:         * If you would like a copy of the GNU General Public License write to
021:         *
022:         * Free Software Foundation, Inc.
023:         * 59 Temple Place - Suite 330
024:         * Boston, MA 02111-1307, USA.
025:         *
026:         *
027:         * To arrange commercial support and licensing, contact ivata at
028:         *                  http://www.ivata.com/contact.jsp
029:         * -----------------------------------------------------------------------------
030:         * $Log: ProductDO.java,v $
031:         * Revision 1.9  2005/10/12 18:19:42  colinmacleod
032:         * Fixed some style issues.
033:         *
034:         * Revision 1.8  2005/10/03 10:17:24  colinmacleod
035:         * Fixed some style and javadoc issues.
036:         *
037:         * Revision 1.7  2005/09/14 12:41:33  colinmacleod
038:         * Added serialVersionUID.
039:         *
040:         * Revision 1.6  2005/04/09 18:04:13  colinmacleod
041:         * Changed copyright text to GPL v2 explicitly.
042:         *
043:         * Revision 1.5  2005/01/19 12:17:02  colinmacleod
044:         * Added logging to catch form clear bug.
045:         *
046:         * Revision 1.4  2005/01/07 09:13:04  colinmacleod
047:         * Added newline to end of file.
048:         *
049:         * Revision 1.3  2005/01/07 08:08:18  colinmacleod
050:         * Moved up a version number.
051:         * Changed copyright notices to 2005.
052:         * Updated the documentation:
053:         *   - started working on multiproject:site docu.
054:         *   - changed the logo.
055:         * Added checkstyle and fixed LOADS of style issues.
056:         * Added separate third-party subproject.
057:         * Added struts (in web), util and webgui (in webtheme) from ivata op.
058:         *
059:         * Revision 1.2  2004/11/11 13:17:13  colinmacleod
060:         * Changed to extend DemoValueObject.
061:         *
062:         * Revision 1.1.1.1  2004/05/16 20:40:07  colinmacleod
063:         * Ready for 0.1 release
064:         * -----------------------------------------------------------------------------
065:         */
066:        package com.ivata.mask.web.demo.product;
067:
068:        import java.math.BigDecimal;
069:
070:        import org.apache.log4j.Logger;
071:
072:        import com.ivata.mask.web.demo.valueobject.DemoValueObject;
073:
074:        /**
075:         * <p>
076:         * Represents a single product which can be ordered.
077:         * </p>
078:         *
079:         * @author Colin MacLeod
080:         * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
081:         * @since ivata masks 0.1 (2004-05-09)
082:         * @version $Revision: 1.9 $
083:         */
084:        public final class ProductDO extends DemoValueObject {
085:            /**
086:             * Serialization version (for <code>Serializable</code> interface).
087:             */
088:            private static final long serialVersionUID = 1L;
089:
090:            /**
091:             * Logger for this class.
092:             */
093:            private static final Logger logger = Logger
094:                    .getLogger(ProductDO.class);
095:
096:            /**
097:             * <p>
098:             * Full text description of the product.
099:             * </p>
100:             */
101:            private String description;
102:            /**
103:             * <p>
104:             * Name of the product. Clear text name, should be unique, though this is
105:             * not enforced.
106:             * </p>
107:             */
108:            private String name;
109:            /**
110:             * <p>
111:             * Cost of each item of this product.
112:             * </p>
113:             */
114:            private BigDecimal price;
115:
116:            /**
117:             * <p>
118:             * Construct a new product instance with no id.
119:             * </p>
120:             */
121:            public ProductDO() {
122:                super ();
123:            }
124:
125:            /**
126:             * <p>
127:             * Construct a new product instance with the given unique identifier.
128:             * </p>
129:             *
130:             * @param id
131:             *            unique identifier of this product.
132:             */
133:            public ProductDO(final int id) {
134:                super (id);
135:            }
136:
137:            /**
138:             * The product's description is a long text designed to make you desperate
139:             * to own one immediately.
140:             *
141:             * @return long text designed to make you drool.
142:             */
143:            public String getDescription() {
144:                return description;
145:            }
146:
147:            /**
148:             * For products, the value displayed is always the product's name.
149:             *
150:             * @return just returns the product's name.
151:             * @see com.ivata.mask.valueobject.ValueObject#getStringValue()
152:             */
153:            public String getDisplayValue() {
154:                return name;
155:            }
156:
157:            /**
158:             * The name of a product is unique among products - that short text which
159:             * uniquely identifies it.
160:             *
161:             * @return unique name of this product.
162:             */
163:            public String getName() {
164:                return name;
165:            }
166:
167:            /**
168:             * What price quality? This is the cost of a single unit of the product.
169:             *
170:             * @return cost of a single unit of the product.
171:             */
172:            public BigDecimal getPrice() {
173:                return price;
174:            }
175:
176:            /**
177:             * The product's description is a long text designed to make you desperate
178:             * to own one immediately.
179:             *
180:             * @param descriptionParam long text designed to make you drool.
181:             */
182:            public void setDescription(final String descriptionParam) {
183:                if (logger.isDebugEnabled()) {
184:                    logger.debug("Set description was '" + description
185:                            + "', now '" + descriptionParam + "'");
186:                }
187:                description = descriptionParam;
188:            }
189:
190:            /**
191:             * The name of a product is unique among products - that short text which
192:             * uniquely identifies it.
193:             *
194:             * @param nameParam unique name of this product.
195:             */
196:            public void setName(final String nameParam) {
197:                if (logger.isDebugEnabled()) {
198:                    logger.debug("Set name was '" + name + "', now '"
199:                            + nameParam + "'");
200:                }
201:                name = nameParam;
202:            }
203:
204:            /**
205:             * Set the cost of one unit of this product.
206:             *
207:             * @param priceParam cost of a single unit of this product.
208:             */
209:            public void setPrice(final BigDecimal priceParam) {
210:                if (logger.isDebugEnabled()) {
211:                    logger.debug("Set price was '" + price + "', now '"
212:                            + priceParam + "'");
213:                }
214:                if ((price != null) && (priceParam == null)) {
215:                    throw new NullPointerException();
216:                }
217:                price = priceParam;
218:            }
219:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.