Source Code Cross Referenced for MetaCompound.java in  » Database-ORM » ODAL » com » completex » objective » components » persistency » meta » 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 » ODAL » com.completex.objective.components.persistency.meta 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         *  Objective Database Abstraction Layer (ODAL)
003:         *  Copyright (c) 2004, The ODAL Development Group
004:         *  All rights reserved.
005:         *  For definition of the ODAL Development Group please refer to LICENCE.txt file
006:         *
007:         *  Distributable under LGPL license.
008:         *  See terms of license at gnu.org.
009:         */package com.completex.objective.components.persistency.meta;
010:
011:        import com.completex.objective.util.PropertyMap;
012:        import com.completex.objective.components.persistency.Mappable;
013:
014:        import java.util.Iterator;
015:        import java.util.LinkedHashMap;
016:        import java.util.Map;
017:
018:        /**
019:         * @author Gennady Krizhevsky
020:         */
021:        public class MetaCompound implements  Mappable {
022:
023:            public static final String TAG_DELEGATE_FACTORY = "delegateFactory";
024:            public static final String TAG_OVER_RIDE_PARENT = "overRideParent";
025:            public static final String TAG_COMPOUND_CHILDREN = "children";
026:
027:            private MetaDelegateFactory delegateFactory;
028:            private boolean overRideParent;
029:            private Map children = new LinkedHashMap(); // Map<MetaCompoundChild>
030:
031:            public MetaCompound() {
032:            }
033:
034:            public MetaCompound(Map map) {
035:                fromMap(map);
036:            }
037:
038:            public MetaDelegateFactory getDelegateFactory() {
039:                return delegateFactory;
040:            }
041:
042:            public boolean isOverRideParent() {
043:                return overRideParent;
044:            }
045:
046:            public void setOverRideParent(boolean overRideParent) {
047:                this .overRideParent = overRideParent;
048:            }
049:
050:            public Map getChildren() {
051:                return children;
052:            }
053:
054:            public boolean hasChildren() {
055:                return children != null && !children.isEmpty();
056:            }
057:
058:            public boolean isEmpty() {
059:                return delegateFactory == null && !hasChildren();
060:            }
061:
062:            public Map toMap() {
063:                Map map = new LinkedHashMap();
064:                if (delegateFactory != null) {
065:                    map.put(TAG_DELEGATE_FACTORY, delegateFactory.toMap());
066:                }
067:                map.put(TAG_OVER_RIDE_PARENT, Boolean.valueOf(overRideParent));
068:                Map childrenMap = new LinkedHashMap();
069:                map.put(TAG_COMPOUND_CHILDREN, childrenMap);
070:                for (Iterator it = children.keySet().iterator(); it.hasNext();) {
071:                    String key = (String) it.next();
072:                    MetaCompoundChild child = (MetaCompoundChild) children
073:                            .get(key);
074:                    childrenMap.put(key, child.toMap());
075:                    child.setName(key);
076:                }
077:                return map;
078:            }
079:
080:            public void fromMap(Map map) {
081:                PropertyMap propertyMap = PropertyMap.toPropertyMap(map);
082:                PropertyMap delegateFactoryMap = propertyMap
083:                        .getPropertyMap(TAG_DELEGATE_FACTORY);
084:
085:                if (delegateFactoryMap != null && !delegateFactoryMap.isEmpty()) {
086:                    delegateFactory = new MetaDelegateFactory(
087:                            delegateFactoryMap);
088:                }
089:
090:                overRideParent = propertyMap.getBoolean(TAG_OVER_RIDE_PARENT);
091:
092:                PropertyMap childrenMap = propertyMap
093:                        .getPropertyMap(TAG_COMPOUND_CHILDREN);
094:                if (childrenMap != null) {
095:                    for (Iterator it = childrenMap.keySet().iterator(); it
096:                            .hasNext();) {
097:                        String key = (String) it.next();
098:                        try {
099:                            PropertyMap childMap = childrenMap
100:                                    .getPropertyMap(key);
101:                            MetaCompoundChild child = new MetaCompoundChild(
102:                                    childMap);
103:                            children.put(key, child);
104:                            child.setName(key);
105:                        } catch (ClassCastException e) {
106:                            throw new RuntimeException(
107:                                    "Class cast exception while reading childMap by key "
108:                                            + key, e);
109:                        }
110:                    }
111:                }
112:            }
113:
114:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.