Source Code Cross Referenced for StandardValidityReport.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » reasoner » 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 » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.reasoner 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /******************************************************************
002:         * File:        StandardValidityReport.java
003:         * Created by:  Dave Reynolds
004:         * Created on:  09-Feb-03
005:         * 
006:         * (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
007:         * [See end of file]
008:         * $Id: StandardValidityReport.java,v 1.13 2008/01/02 12:07:00 andy_seaborne Exp $
009:         *****************************************************************/package com.hp.hpl.jena.reasoner;
010:
011:        import java.util.*;
012:
013:        /**
014:         * Default implementation of ValidityReport which simply stores a list
015:         * of precomputed Report records.
016:         * 
017:         * @author <a href="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
018:         * @version $Revision: 1.13 $ on $Date: 2008/01/02 12:07:00 $
019:         */
020:        public class StandardValidityReport implements  ValidityReport {
021:
022:            /** The total set of error reports */
023:            protected List reports = new ArrayList();
024:
025:            /** Flag to indicate if there are any error reports so far */
026:            protected boolean isError;
027:
028:            /**
029:             * Add a new error report
030:             * @param error true if the report is an error, false if it is just a warning
031:             * @param type a string giving a reasoner-dependent classification for the report
032:             * @param description a textual description of the problem
033:             */
034:            public void add(boolean error, String type, String description) {
035:                add(error, type, description, null);
036:            }
037:
038:            /**
039:             * Add a new error report
040:             * @param error true if the report is an error, false if it is just a warning
041:             * @param type a string giving a reasoner-dependent classification for the report
042:             * @param description a textual description of the problem
043:             * @param extension Optional argument with extension data about the reported error
044:             */
045:            public void add(boolean error, String type, String description,
046:                    Object extension) {
047:                reports.add(new Report(error, type, description, extension));
048:                if (error) {
049:                    isError = true;
050:                }
051:            }
052:
053:            /**
054:             * Add a new error report
055:             * @param report a ValidityReport.Report to add, can be null 
056:             */
057:            public void add(ValidityReport.Report report) {
058:                if (report == null)
059:                    return;
060:                reports.add(report);
061:                if (report.isError) {
062:                    isError = true;
063:                }
064:            }
065:
066:            /**
067:             * Returns true if no logical inconsistencies were detected (in which case
068:             * there will be at least one error Report included). Warnings may still
069:             * be present. As of Jena 2.2 we regard classes which can't be instantiated
070:             * as warnings rather than errors. 
071:             */
072:            public boolean isValid() {
073:                return !isError;
074:            }
075:
076:            /**
077:             * Returns true if the model is both valid (logically consistent) and no
078:             * warnings were generated. 
079:             */
080:            public boolean isClean() {
081:                return reports.isEmpty();
082:            }
083:
084:            /**
085:             * Return a count of the number of warning or error reports
086:             * generated by the validation.
087:             */
088:            public int size() {
089:                return reports.size();
090:            }
091:
092:            /**
093:             * Return an iterator over the separate ValidityReport.Report records.
094:             */
095:            public Iterator getReports() {
096:                return reports.iterator();
097:            }
098:
099:        }
100:
101:        /*
102:         * (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
103:         * All rights reserved.
104:         *
105:         * Redistribution and use in source and binary forms, with or without
106:         * modification, are permitted provided that the following conditions
107:         * are met:
108:         * 1. Redistributions of source code must retain the above copyright
109:         *    notice, this list of conditions and the following disclaimer.
110:         * 2. Redistributions in binary form must reproduce the above copyright
111:         *    notice, this list of conditions and the following disclaimer in the
112:         *    documentation and/or other materials provided with the distribution.
113:         * 3. The name of the author may not be used to endorse or promote products
114:         *    derived from this software without specific prior written permission.
115:         *
116:         * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
117:         * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
118:         * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
119:         * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
120:         * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
121:         * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
122:         * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
123:         * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
124:         * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
125:         * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
126:         */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.