Source Code Cross Referenced for JPackage.java in  » Search-Engine » semweb4j » org » ontoware » rdfreactor » generator » java » 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 » Search Engine » semweb4j » org.ontoware.rdfreactor.generator.java 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.ontoware.rdfreactor.generator.java;
002:
003:        import java.util.ArrayList;
004:        import java.util.List;
005:
006:        import org.apache.commons.logging.Log;
007:        import org.apache.commons.logging.LogFactory;
008:
009:        /**
010:         * A <b>JPackage</b> represents a package in Java. 
011:         * Explicit modelling of packages allows the mapping of different namespaces in RDF to 
012:         * different Java packages.  
013:         * 
014:         * A JPackage has a name (typically with dots) and a List of JClass instances, 
015:         * representing the classes in the package. 
016:         * 
017:         * @author $Author: xamde $
018:         * @version $Id: JPackage.java,v 1.8 2006/06/21 13:24:40 xamde Exp $
019:         * 
020:         */
021:        public class JPackage {
022:
023:            public static final JPackage JAVA_LANG = new JPackage("java.lang");
024:
025:            public static final JPackage JAVA_UTIL = new JPackage("java.util");
026:
027:            public static final JPackage RDFSCHEMA = new JPackage(
028:                    "org.ontoware.rdfreactor.schema.rdfs");
029:
030:            public static final JPackage OWL = new JPackage(
031:                    "org.ontoware.rdfreactor.schema.owl");
032:
033:            private static Log log = LogFactory.getLog(JPackage.class);
034:
035:            /** the name of the JPackage, usually it conforms to java package naming conventions */
036:            private String name;
037:
038:            /** the List of JClasses belonging to this JPackage */
039:            private List<JClass> classes = new ArrayList<JClass>();
040:
041:            public JPackage(String name) {
042:                this .name = name;
043:            }
044:
045:            public String getName() {
046:                return this .name;
047:            }
048:
049:            public void addClass(JClass someClass) {
050:                classes.add(someClass);
051:            }
052:
053:            public List<JClass> getClasses() {
054:                return this .classes;
055:            }
056:
057:            /**
058:             * apply consistency checks to this JPackage and all instances 
059:             * of JClass and JProperty in it.
060:             * 
061:             * @return true if the JPackage and all its parts are consistent
062:             */
063:            public boolean isConsistent() {
064:                boolean result = true;
065:                for (JClass jc : classes) {
066:                    if (!jc.isConsistent())
067:                        log.warn(jc.getName() + " is not consistent");
068:                    result &= jc.isConsistent();
069:                }
070:                return result;
071:            }
072:
073:            public String toString() {
074:                StringBuffer buf = new StringBuffer();
075:                buf.append("  JPackage " + name + "\n");
076:                for (JClass jc : classes) {
077:                    buf.append(jc.toDebug());
078:                }
079:                return buf.toString();
080:            }
081:
082:            /** generate a verbose report of this JPackage */
083:            public String toReport() {
084:                StringBuffer buf = new StringBuffer();
085:                buf.append("Package -------------------\n");
086:                for (JClass jc : classes) {
087:                    buf.append(jc.toReport());
088:                }
089:                return buf.toString();
090:            }
091:
092:            /**
093:             * two packages are equal, iff they have the same name. Note: they may have
094:             * different classes.
095:             */
096:            public boolean equals(Object other) {
097:                return (other instanceof  JPackage && ((JPackage) other)
098:                        .getName().equals(this.getName()));
099:            }
100:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.