Source Code Cross Referenced for EntityHelper.java in  » UML » MetaBoss » com » metaboss » sdlctools » models » modelassistant » metabossmodel » implicittypes » 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 » UML » MetaBoss » com.metaboss.sdlctools.models.modelassistant.metabossmodel.implicittypes 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
002:        // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
003:        // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
004:        // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
005:        // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
006:        // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
007:        // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
008:        // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
009:        // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
010:        // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
011:        // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
012:        // POSSIBILITY OF SUCH DAMAGE.
013:        //
014:        // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
015:        package com.metaboss.sdlctools.models.modelassistant.metabossmodel.implicittypes;
016:
017:        import java.util.Collection;
018:        import java.util.List;
019:
020:        import javax.jmi.reflect.ConstraintViolationException;
021:
022:        import com.metaboss.sdlctools.models.ModelRepositoryException;
023:        import com.metaboss.sdlctools.models.metabossmodel.datadictionarymodel.DataType;
024:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.Entity;
025:
026:        /** This class holds details about Entity. Used internally in the Assistant impl */
027:        class EntityHelper {
028:            private ModelAssistantImpl mModelAssistantImpl;
029:
030:            // This helper is looking at the conditions and ensuring the inegrity of the data type
031:            // it will create the missing data type and delete exta one if necessary
032:            static void verifyEntityIntegrity(Collection pViolations,
033:                    ModelAssistantImpl pModelAssistantImpl, Entity lEntity,
034:                    List pUnprocessedDataTypes, HelperContext pHelperContext) {
035:                // Get all enterprise datatypes
036:                DataType lBooleanFlagDataType = pHelperContext
037:                        .getBooleanFlagDataType();
038:                if (lBooleanFlagDataType == null)
039:                    return; // No mandatory data type
040:                DataType lActualCollectionContainsFlagDataType = lEntity
041:                        .getCollectionContainsFlagDataType();
042:                if (lActualCollectionContainsFlagDataType == null
043:                        || lActualCollectionContainsFlagDataType
044:                                .equals(lBooleanFlagDataType) == false)
045:                    pViolations.add(new ConstraintViolationException(lEntity,
046:                            lEntity.refMetaObject(),
047:                            "The Entity CollectionContainsFlag data type must be set to "
048:                                    + lBooleanFlagDataType.getRef()
049:                                    + " data type."));
050:                DataType lActualCollectionEmptyFlagDataType = lEntity
051:                        .getCollectionEmptyFlagDataType();
052:                if (lActualCollectionEmptyFlagDataType == null
053:                        || lActualCollectionEmptyFlagDataType
054:                                .equals(lBooleanFlagDataType) == false)
055:                    pViolations.add(new ConstraintViolationException(lEntity,
056:                            lEntity.refMetaObject(),
057:                            "The Entity CollectionEmptyFlag data type must be set to "
058:                                    + lBooleanFlagDataType.getRef()
059:                                    + " data type."));
060:
061:                DataType lCollectionOffsetDataType = pHelperContext
062:                        .getCollectionOffsetDataType();
063:                if (lCollectionOffsetDataType == null)
064:                    return; // No mandatory data type
065:                DataType lActualCollectionOffsetDataType = lEntity
066:                        .getCollectionOffsetDataType();
067:                if (lActualCollectionOffsetDataType == null
068:                        || lActualCollectionOffsetDataType
069:                                .equals(lCollectionOffsetDataType) == false)
070:                    pViolations.add(new ConstraintViolationException(lEntity,
071:                            lEntity.refMetaObject(),
072:                            "The Entity CollectionOffset data type must be set to "
073:                                    + lBooleanFlagDataType.getRef()
074:                                    + " data type."));
075:
076:                DataType lCollectionSizeDataType = pHelperContext
077:                        .getCollectionSizeDataType();
078:                if (lCollectionSizeDataType == null)
079:                    return; // No mandatory data type
080:                DataType lActualCollectionSizeDataType = lEntity
081:                        .getCollectionSizeDataType();
082:                if (lActualCollectionSizeDataType == null
083:                        || lActualCollectionSizeDataType
084:                                .equals(lCollectionSizeDataType) == false)
085:                    pViolations.add(new ConstraintViolationException(lEntity,
086:                            lEntity.refMetaObject(),
087:                            "The Entity CollectionSize data type must be set to "
088:                                    + lBooleanFlagDataType.getRef()
089:                                    + " data type."));
090:
091:                DataType lSubsetSizeDataType = pHelperContext
092:                        .getSubsetSizeDataType();
093:                if (lSubsetSizeDataType == null)
094:                    return; // No mandatory data type
095:                DataType lActualSubsetSizeDataType = lEntity
096:                        .getSubsetSizeDataType();
097:                if (lActualSubsetSizeDataType == null
098:                        || lActualSubsetSizeDataType
099:                                .equals(lSubsetSizeDataType) == false)
100:                    pViolations.add(new ConstraintViolationException(lEntity,
101:                            lEntity.refMetaObject(),
102:                            "The Entity SubsetSize data type must be set to "
103:                                    + lBooleanFlagDataType.getRef()
104:                                    + " data type."));
105:
106:                // Now call specific helpers to help with validation entity related data types
107:                // Work on Instance id data type
108:                EntityInstanceIdDataTypeHelper
109:                        .verifyEntityInstanceIdDataTypeIntegrity(pViolations,
110:                                pModelAssistantImpl, lEntity,
111:                                pUnprocessedDataTypes, pHelperContext);
112:                // Work on Version Id data type
113:                EntityVersionIdDataTypeHelper
114:                        .verifyEntityVersionIdDataTypeIntegrity(pViolations,
115:                                pModelAssistantImpl, lEntity,
116:                                pUnprocessedDataTypes, pHelperContext);
117:                // Work on State data type
118:                EntityStateDataTypeHelper.verifyEntityStateDataTypeIntegrity(
119:                        pViolations, pModelAssistantImpl, lEntity,
120:                        pUnprocessedDataTypes, pHelperContext);
121:                // Work on Ordering Instruction data type
122:                EntityOrderingInstructionsDataTypeHelper
123:                        .verifyEntityOrderingInstructionDataTypeIntegrity(
124:                                pViolations, pModelAssistantImpl, lEntity,
125:                                pUnprocessedDataTypes, pHelperContext);
126:            }
127:
128:            // This helper is looking at the conditions and ensuring the inegrity of the data type
129:            // it will create the missing data type and delete exta one if necessary
130:            static void ensureEntityIntegrity(
131:                    ModelAssistantImpl pModelAssistantImpl, Entity pEntity,
132:                    List pUnprocessedDataTypes, HelperContext pHelperContext)
133:                    throws ModelRepositoryException {
134:                // Get all enterprise datatypes
135:                DataType lBooleanFlagDataType = pHelperContext
136:                        .getBooleanFlagDataType();
137:                if (lBooleanFlagDataType == null)
138:                    return; // No mandatory data type
139:                pEntity.setCollectionContainsFlagDataType(lBooleanFlagDataType);
140:                pEntity.setCollectionEmptyFlagDataType(lBooleanFlagDataType);
141:
142:                DataType lCollectionOffsetDataType = pHelperContext
143:                        .getCollectionOffsetDataType();
144:                if (lCollectionOffsetDataType == null)
145:                    return; // No mandatory data type
146:                pEntity.setCollectionOffsetDataType(lCollectionOffsetDataType);
147:
148:                DataType lCollectionSizeDataType = pHelperContext
149:                        .getCollectionSizeDataType();
150:                if (lCollectionSizeDataType == null)
151:                    return; // No mandatory data type
152:                pEntity.setCollectionSizeDataType(lCollectionSizeDataType);
153:
154:                DataType lSubsetSizeDataType = pHelperContext
155:                        .getSubsetSizeDataType();
156:                if (lSubsetSizeDataType == null)
157:                    return; // No mandatory data type
158:                pEntity.setSubsetSizeDataType(lSubsetSizeDataType);
159:
160:                // Now call specific helpers to help with entity related data types
161:                // Work on Instance id data type
162:                EntityInstanceIdDataTypeHelper
163:                        .ensureEntityInstanceIdDataTypeIntegrity(
164:                                pModelAssistantImpl, pEntity,
165:                                pUnprocessedDataTypes, pHelperContext);
166:                // Work on Version Id data type
167:                EntityVersionIdDataTypeHelper
168:                        .ensureEntityVersionIdDataTypeIntegrity(
169:                                pModelAssistantImpl, pEntity,
170:                                pUnprocessedDataTypes, pHelperContext);
171:                // Work on State data type
172:                EntityStateDataTypeHelper.ensureEntityStateDataTypeIntegrity(
173:                        pModelAssistantImpl, pEntity, pUnprocessedDataTypes,
174:                        pHelperContext);
175:                // Work on Ordering Instruction data type
176:                EntityOrderingInstructionsDataTypeHelper
177:                        .ensureEntityOrderingInstructionDataTypeIntegrity(
178:                                pModelAssistantImpl, pEntity,
179:                                pUnprocessedDataTypes, pHelperContext);
180:            }
181:        }
w_w___w._j_a__v__a__2___s___.___com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.