Source Code Cross Referenced for MetaModelsExtractor.java in  » Database-ORM » ODAL » com » completex » objective » tools » generators » 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.tools.generators 
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.tools.generators;
010:
011:        import com.completex.objective.components.persistency.meta.MetaModel;
012:        import com.completex.objective.components.persistency.ColumnType;
013:        import com.completex.objective.components.persistency.MetaTable;
014:        import com.completex.objective.components.persistency.MetaColumn;
015:        import com.completex.objective.util.PropertyMap;
016:
017:        import java.util.LinkedHashMap;
018:        import java.util.Map;
019:        import java.util.Set;
020:        import java.util.Properties;
021:
022:        /**
023:         * @author Gennady Krizhevsky
024:         */
025:        public interface MetaModelsExtractor {
026:            /**
027:             * @param propertiesPath
028:             * @return meta models
029:             * @throws Exception
030:             */
031:            ExtractStruct extractMetaModels(String propertiesPath)
032:                    throws Exception;
033:
034:            ExtractStruct extractMetaModels(String propertiesPath,
035:                    Properties env) throws Exception;
036:
037:            String javaType(ColumnType type);
038:
039:            Map prepareClassTableTemplateMap(MetaTable table,
040:                    LineStruct classStruct, LineStruct intfStruct);
041:
042:            Map prepareInterfaceTableMap(MetaTable table, LineStruct intfStruct);
043:
044:            static class LineStruct implements  Cloneable {
045:                String inFilePath;
046:                String exFilePath;
047:                String outputPath;
048:                String packageName;
049:                String templatePath;
050:                String filterPattern;
051:                String classPrefix;
052:                String classSuffix;
053:                String parentClass;
054:                String implements String;
055:                boolean generateInterfaces;
056:                boolean generateLifeCycleCtl;
057:                boolean generateBean = true;
058:                boolean debug;
059:
060:                String genericImports;
061:                String specificImports;
062:
063:                String metaAssemblyTemplatePath;
064:                String metaAssemblyClassPrefix;
065:                String metaAssemblyClassSuffix;
066:
067:                public Object clone() throws CloneNotSupportedException {
068:                    return super .clone();
069:                }
070:            }
071:
072:            static class LineStructBlock implements  Cloneable {
073:                LineStruct classStruct;
074:                LineStruct intfStruct;
075:                PropertyMap propertyMap;
076:
077:                private LineStructBlock[] blocks;
078:
079:                public LineStructBlock(LineStruct classStruct,
080:                        LineStruct intfStruct, PropertyMap propertyMap) {
081:                    this .classStruct = classStruct;
082:                    this .intfStruct = intfStruct;
083:                    this .propertyMap = propertyMap;
084:                }
085:
086:                public Object clone() throws CloneNotSupportedException {
087:                    LineStructBlock block = (LineStructBlock) super .clone();
088:                    block.classStruct = (LineStruct) classStruct.clone();
089:                    block.intfStruct = intfStruct == null ? null
090:                            : (LineStruct) intfStruct.clone();
091:                    return block;
092:                }
093:
094:                LineStructBlock[] splitBlocks()
095:                        throws CloneNotSupportedException {
096:                    if (this .blocks == null) {
097:                        String[] externals = classStruct.exFilePath.split(",");
098:                        LineStructBlock[] blocks = new LineStructBlock[externals.length];
099:                        for (int i = 0; i < blocks.length; i++) {
100:                            blocks[i] = (LineStructBlock) clone();
101:                            blocks[i].classStruct.exFilePath = externals[i]
102:                                    .trim();
103:                            if (blocks[i].intfStruct != null) {
104:                                blocks[i].intfStruct.exFilePath = externals[i]
105:                                        .trim();
106:                            }
107:                        }
108:                        this .blocks = blocks;
109:                    }
110:                    return this .blocks;
111:                }
112:
113:                public PropertyMap getPropertyMap() {
114:                    return propertyMap;
115:                }
116:            }
117:
118:            public static class ExtractStructEntry {
119:
120:                public ExtractStructEntry() {
121:                }
122:
123:                public ExtractStructEntry(Number modelIndex,
124:                        MetaTable metaTables) {
125:                    this .modelIndex = modelIndex;
126:                    this .metaTable = metaTables;
127:                }
128:
129:                private Number modelIndex;
130:                private MetaTable metaTable;
131:                private boolean used;
132:                private String baseClassPackageName;
133:
134:                public Number getModelIndex() {
135:                    return modelIndex;
136:                }
137:
138:                public void setModelIndex(Number modelIndex) {
139:                    this .modelIndex = modelIndex;
140:                }
141:
142:                public MetaTable getMetaTable() {
143:                    return metaTable;
144:                }
145:
146:                public void setMetaTable(MetaTable metaTable) {
147:                    this .metaTable = metaTable;
148:                }
149:
150:                public boolean isUsed() {
151:                    return used;
152:                }
153:
154:                public void setUsed(boolean used) {
155:                    this .used = used;
156:                }
157:
158:                public String getBaseClassPackageName() {
159:                    return baseClassPackageName;
160:                }
161:
162:                public void setBaseClassPackageName(String baseClassPackageName) {
163:                    this .baseClassPackageName = baseClassPackageName;
164:                }
165:            }
166:
167:            public static class ExtractStruct {
168:
169:                private MetaModelsExtractor metaModelsExtractor;
170:                private LineStructBlock[] blocks;
171:                private MetaModel[] metaModels;
172:                private LinkedHashMap entries = new LinkedHashMap();
173:
174:                public ExtractStruct() {
175:                }
176:
177:                public ExtractStruct(MetaModelsExtractor metaModelsExtractor,
178:                        LineStructBlock[] blocks) {
179:                    this .metaModelsExtractor = metaModelsExtractor;
180:                    this .blocks = blocks;
181:                }
182:
183:                public ExtractStructEntry putEntry(String key,
184:                        ExtractStructEntry entry) {
185:                    return (ExtractStructEntry) entries.put(key, entry);
186:                }
187:
188:                public ExtractStructEntry getEntry(String key) {
189:                    return (ExtractStructEntry) entries.get(key);
190:                }
191:
192:                public Set getEntryKeys() {
193:                    return entries.keySet();
194:                }
195:
196:                public LineStructBlock getBlock(int i) {
197:                    return blocks[i];
198:                }
199:
200:                public LineStructBlock[] getBlocks() {
201:                    return blocks;
202:                }
203:
204:                public MetaModel getMetaModel(int i) {
205:                    return metaModels[i];
206:                }
207:
208:                public MetaModel[] getMetaModels() {
209:                    return metaModels;
210:                }
211:
212:                public void setMetaModels(MetaModel[] metaModels) {
213:                    this .metaModels = metaModels;
214:                }
215:
216:                public MetaModelsExtractor getMetaModelsExtractor() {
217:                    return metaModelsExtractor;
218:                }
219:
220:                public void resetExcludeColumns() {
221:                    if (metaModels != null) {
222:                        for (int i = 0; i < metaModels.length; i++) {
223:                            MetaModel metaModel = metaModels[i];
224:                            for (MetaModel.MetaTableIterator it = metaModel
225:                                    .tableIterator(); it.hasNext();) {
226:                                MetaTable table = it.nextMetaTable();
227:                                for (int j = 0; j < table.size(); j++) {
228:                                    MetaColumn column = table.getColumn(j);
229:                                    column.setExclude(false);
230:                                }
231:                            }
232:                        }
233:                    }
234:                }
235:
236:            }
237:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.