Source Code Cross Referenced for MakefileData.java in  » J2EE » enhydra-IDE-plugin » org » enhydra » kelp » common » importer » 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 » J2EE » enhydra IDE plugin » org.enhydra.kelp.common.importer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Enhydra Java Application Server Project
003:         *
004:         * The contents of this file are subject to the Enhydra Public License
005:         * Version 1.1 (the "License"); you may not use this file except in
006:         * compliance with the License. You may obtain a copy of the License on
007:         * the Enhydra web site ( http://www.enhydra.org/ ).
008:         *
009:         * Software distributed under the License is distributed on an "AS IS"
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
011:         * the License for the specific terms governing rights and limitations
012:         * under the License.
013:         *
014:         * The Initial Developer of the Enhydra Application Server is Lutris
015:         * Technologies, Inc. The Enhydra Application Server and portions created
016:         * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017:         * All Rights Reserved.
018:         *
019:         * Contributor(s):
020:         *
021:         */
022:        package org.enhydra.kelp.common.importer;
023:
024:        // ToolBox imports
025:        import org.enhydra.tool.ToolBoxInfo;
026:        import org.enhydra.tool.common.PathHandle;
027:
028:        // Standard imports
029:        import java.io.File;
030:        import java.util.Vector;
031:
032:        //
033:        public class MakefileData {
034:            private Vector docVector = new Vector();
035:            private Vector itemVector = new Vector();
036:            private String xmlcOptionFilePath = new String();
037:            private String xmlcParams = new String();
038:
039:            //
040:            private String packPath = new String();
041:            private String docPath = new String();
042:            private String makeParentPath = new String();
043:            private String sourcePath = new String();
044:            private String rootPath = new String();
045:
046:            protected MakefileData(String makeParent, String source) {
047:                makeParentPath = PathHandle.createPathString(makeParent);
048:                sourcePath = PathHandle.createPathString(source);
049:                rootPath = sourcePath; // default
050:            }
051:
052:            protected String getMakeParentPath() {
053:                return makeParentPath;
054:            }
055:
056:            protected String getSourcePath() {
057:                return sourcePath;
058:            }
059:
060:            protected void readRootPath(String p) {
061:                rootPath = PathHandle.createPathString(getMakeParentPath()
062:                        + File.separator + p);
063:            }
064:
065:            protected String getRootPath() {
066:                return rootPath;
067:            }
068:
069:            protected void readXMLCOptionFilePath(String p) {
070:                xmlcOptionFilePath = PathHandle
071:                        .createPathString(getMakeParentPath() + File.separator
072:                                + p);
073:            }
074:
075:            protected String getXMLCOptionFilePath() {
076:                return xmlcOptionFilePath;
077:            }
078:
079:            protected void readPackagePath(String d) {
080:                packPath = PathHandle.createPathString(sourcePath
081:                        + File.separator + d);
082:            }
083:
084:            protected String getPackagePath() {
085:                return packPath;
086:            }
087:
088:            protected String getJavaPackage() {
089:                String javaPack = new String();
090:                PathHandle sourceHandle = null;
091:                PathHandle packHandle = null;
092:                int index = -1;
093:
094:                sourceHandle = PathHandle.createPathHandle(getSourcePath());
095:                packHandle = PathHandle.createPathHandle(getPackagePath());
096:                if (sourceHandle.parentOf(packHandle)) {
097:                    index = packHandle.getPath()
098:                            .indexOf(sourceHandle.getPath());
099:                    if (index > -1) {
100:                        javaPack = packHandle.getPath().substring(
101:                                sourceHandle.getPath().length() + 1);
102:                        javaPack = javaPack.replace('/', '.');
103:                    }
104:                }
105:                return javaPack;
106:            }
107:
108:            protected void readDocPath(String p) {
109:                int index = -1;
110:
111:                index = p.indexOf(')');
112:                if (index > 0) {
113:                    p = getRootPath() + p.substring(index + 1);
114:                } else {
115:                    p = getMakeParentPath() + File.separator + p;
116:                }
117:                docPath = PathHandle.createPathString(p);
118:            }
119:
120:            protected String getDocPath() {
121:                return docPath;
122:            }
123:
124:            protected void setXMLCParameters(String p) {
125:                if (p == null) {
126:                    xmlcParams = new String();
127:                } else {
128:                    xmlcParams = p.trim();
129:                }
130:            }
131:
132:            protected String getXMLCParameters() {
133:                return xmlcParams;
134:            }
135:
136:            protected void addSourceDocPath(String className) {
137:                String docResourcePath = new String();
138:                String docSourcePath = new String();
139:
140:                if ((className != null) && (className.trim().length() > 0)) {
141:                    docResourcePath = createSourceDocPath(getMakeParentPath(),
142:                            className);
143:                    docSourcePath = createSourceDocPath(getDocPath(), className);
144:                    File f = new File(docResourcePath);
145:
146:                    if (f.exists()) {
147:                        docVector.addElement(docResourcePath);
148:                    } else {
149:                        f = new File(docSourcePath);
150:                        if (f.exists()) {
151:                            docVector.addElement(docSourcePath);
152:                        }
153:                    }
154:                }
155:            }
156:
157:            private String createSourceDocPath(String parentPath,
158:                    String className) {
159:                PathHandle handle = null;
160:                String path = null;
161:                String[] docTypes = ToolBoxInfo.getSupportedDocTypes();
162:                StringBuffer newPath = new StringBuffer();
163:                int extLength = 3;
164:
165:                handle = PathHandle.createPathHandle(parentPath
166:                        + File.separator + className);
167:                path = handle.getPath();
168:                for (int i = 0; i < docTypes.length; i++) {
169:                    if (handle.endsWith(docTypes[i])) {
170:                        if (docTypes[i].length() > extLength) {
171:                            extLength = docTypes[i].length();
172:                        }
173:                    }
174:                }
175:                newPath.append(path.substring(0, path.length() - extLength));
176:                newPath.append('.');
177:                newPath.append(path.substring(path.length() - extLength)
178:                        .toLowerCase());
179:                return newPath.toString();
180:            }
181:
182:            protected String[] getSourceDocPaths() {
183:                String[] paths = new String[docVector.size()];
184:
185:                paths = (String[]) docVector.toArray(paths);
186:                return paths;
187:            }
188:
189:            protected boolean containSourceDoc(String inPath) {
190:                String[] docs = new String[0];
191:                PathHandle handle = null;
192:                boolean contains = false;
193:
194:                docs = getSourceDocPaths();
195:                handle = PathHandle.createPathHandle(inPath);
196:                for (int i = 0; i < docs.length; i++) {
197:                    if (handle.equals(docs[i])) {
198:                        contains = true;
199:                        break;
200:                    }
201:                }
202:                return contains;
203:            }
204:
205:            protected void addItem(String i, String o) {
206:                MakeItemData data = new MakeItemData(i, o);
207:
208:                itemVector.addElement(data);
209:            }
210:
211:            protected MakeItemData[] getItems() {
212:                MakeItemData[] items = new MakeItemData[itemVector.size()];
213:
214:                items = (MakeItemData[]) itemVector.toArray(items);
215:                return items;
216:            }
217:
218:            protected boolean isSymbolic() {
219:                boolean sym = false;
220:
221:                if (isXMLC()) {
222:                    PathHandle packHandle = null;
223:
224:                    packHandle = PathHandle.createPathHandle(getPackagePath());
225:                    if (packHandle.equals(getMakeParentPath())) {
226:
227:                        // Not symbolic
228:                    } else {
229:                        sym = true;
230:                    }
231:                }
232:                return sym;
233:            }
234:
235:            protected boolean isXMLC() {
236:                boolean is = false;
237:                StringBuffer buf = new StringBuffer();
238:
239:                buf.append(getXMLCOptionFilePath());
240:                buf.append(getXMLCParameters());
241:                buf.append(getDocPath());
242:                if (buf.toString().trim().length() > 0) {
243:                    is = true;
244:                } else if (getSourceDocPaths().length >= 1) {
245:                    is = true;
246:                } else if (getItems().length >= 1) {
247:                    is = true;
248:                }
249:                return is;
250:            }
251:
252:            public String toString() {
253:                StringBuffer buf = new StringBuffer();
254:
255:                buf.append("makeParentPath: " + getMakeParentPath() + '\n'); // nores
256:                buf.append("sourcePath: " + getSourcePath() + '\n'); // nores
257:                buf.append("rootPath: " + getRootPath() + '\n'); // nores
258:                buf.append("packagePath: " + getPackagePath() + '\n'); // nores
259:                buf.append("xmlcOptionFilePath: " + getXMLCOptionFilePath()
260:                        + '\n'); // nores
261:                buf.append("xmlcParameters: " + getXMLCParameters() + '\n'); // nores
262:                buf.append("DocPath: " + getDocPath() + '\n'); // nores
263:                String[] paths = getSourceDocPaths();
264:
265:                for (int i = 0; i < paths.length; i++) {
266:                    buf.append("Class doc path: " + paths[i] + '\n'); // nores
267:                }
268:                MakeItemData[] ids = getItems();
269:
270:                for (int i = 0; i < ids.length; i++) {
271:                    buf.append(ids[i].toString());
272:                    buf.append('\n');
273:                }
274:                return buf.toString();
275:            }
276:
277:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.