Source Code Cross Referenced for ExtensionPropertySet.java in  » ERP-CRM-Financial » jmoney » net » sf » jmoney » model2 » 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 » ERP CRM Financial » jmoney » net.sf.jmoney.model2 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *
003:         *  JMoney - A Personal Finance Manager
004:         *  Copyright (c) 2004 Nigel Westbury <westbury@users.sourceforge.net>
005:         *
006:         *
007:         *  This program is free software; you can redistribute it and/or modify
008:         *  it under the terms of the GNU General Public License as published by
009:         *  the Free Software Foundation; either version 2 of the License, or
010:         *  (at your option) any later version.
011:         *
012:         *  This program 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
015:         *  GNU General Public License for more details.
016:         *
017:         *  You should have received a copy of the GNU General Public License
018:         *  along with this program; if not, write to the Free Software
019:         *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
020:         *
021:         */
022:
023:        package net.sf.jmoney.model2;
024:
025:        public class ExtensionPropertySet<E extends ExtensionObject> extends
026:                PropertySet<E> {
027:
028:            private ExtendablePropertySet<?> extendablePropertySet;
029:
030:            /**
031:             * An interface that can be used to construct implementation objects,
032:             * or null if this is an abstract property set.
033:             */
034:            IExtensionObjectConstructors<E> constructors;
035:
036:            /**
037:             * Constructs an extension property set object.
038:             *  
039:             * @param classOfObject
040:             * @param constructors
041:             *            a required interface containing methods for constructing
042:             *            implementation objects
043:             */
044:            protected ExtensionPropertySet(Class<E> classOfObject,
045:                    ExtendablePropertySet<?> extendablePropertySet,
046:                    IExtensionObjectConstructors<E> constructors) {
047:                this .isExtension = true;
048:                this .classOfObject = classOfObject;
049:                this .extendablePropertySet = extendablePropertySet;
050:                this .constructors = constructors;
051:
052:                // TODO: move outside this constructor.
053:                if (extendablePropertySet == null) {
054:                    throw new MalformedPluginException(
055:                            "A non-null extendable property set must be passed.");
056:                }
057:            }
058:
059:            @Override
060:            public void initProperties(String propertySetId) {
061:                super .initProperties(propertySetId);
062:
063:                // Add to our map that maps ids to ExtensionPropertySet objects.
064:                allExtensionPropertySetsMap.put(propertySetId, this );
065:
066:                // Add to our map that maps ids to ExtensionPropertySet objects
067:                // within a particular extendable object.
068:                extendablePropertySet.extensionPropertySets.put(propertySetId,
069:                        this );
070:                /*		
071:                 // Build the list of properties that are passed to
072:                 // the 'new object' constructor and another list that
073:                 // are passed to the 're-instantiating' constructor.
074:
075:                 constructorProperties = new Vector<PropertyAccessor>();
076:                 defaultConstructorProperties = new Vector<PropertyAccessor>();
077:
078:                 // This property set is an extension.
079:                 int parameterIndex = 0;
080:                 for (PropertyAccessor propertyAccessor: properties) {
081:                 constructorProperties.add(propertyAccessor);
082:                 propertyAccessor.setIndexIntoConstructorParameters(parameterIndex++);
083:                 if (propertyAccessor.isList()) {
084:                 defaultConstructorProperties.add(propertyAccessor);
085:                 }
086:                 }
087:                 */
088:            }
089:
090:            public ExtendablePropertySet getExtendablePropertySet() {
091:                return extendablePropertySet;
092:            }
093:
094:            /**
095:             * This method should be used only by plug-ins that implement
096:             * a datastore.
097:             * @param constructorParameters an array of values to be passed to
098:             * 		the constructor.  If an extendable object is being constructed
099:             * 		then the first three elements of this array must be the
100:             * 		object key, the extension map, and the parent object key.
101:             * 
102:             * @return A newly constructed object, constructed from the given
103:             * 		parameters.  This object may be an ExtendableObject or
104:             * 		may be an ExtensionObject.
105:             */
106:            public E constructImplementationObject(
107:                    ExtendableObject extendedObject, IValues values) {
108:                E extensionObject = constructors.construct(extendedObject,
109:                        values);
110:                extensionObject.setPropertySet(this );
111:                return extensionObject;
112:            }
113:
114:            /**
115:             * This method should be used only by plug-ins that implement
116:             * a datastore.
117:             * 
118:             * @return A newly constructed object, constructed from the given
119:             * 		parameters.  This object may be an ExtendableObject or
120:             * 		may be an ExtensionObject.
121:             */
122:            public E constructDefaultImplementationObject(
123:                    ExtendableObject extendedObject) {
124:                E extensionObject = constructors.construct(extendedObject);
125:                extensionObject.setPropertySet(this );
126:                return extensionObject;
127:            }
128:
129:            @Override
130:            protected E getImplementationObject(
131:                    ExtendableObject extendableObject) {
132:                return extendableObject.getExtension(this , true);
133:            }
134:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.