Source Code Cross Referenced for RDFParseException.java in  » RSS-RDF » sesame » org » openrdf » rio » 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 » sesame » org.openrdf.rio 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2007.
003:         *
004:         * Licensed under the Aduna BSD-style license.
005:         */
006:        package org.openrdf.rio;
007:
008:        import org.openrdf.OpenRDFException;
009:
010:        /**
011:         * A parse exception that can be thrown by a parser when it encounters an error
012:         * from which it cannot or doesn't want to recover.
013:         */
014:        public class RDFParseException extends OpenRDFException {
015:
016:            /*-----------*
017:             * Constants *
018:             *-----------*/
019:
020:            private static final long serialVersionUID = -4686126837948873012L;
021:
022:            private final int lineNo;
023:
024:            private final int columnNo;
025:
026:            /*--------------*
027:             * Constructors *
028:             *--------------*/
029:
030:            /**
031:             * Creates a new ParseException.
032:             * 
033:             * @param msg
034:             *        An error message.
035:             */
036:            public RDFParseException(String msg) {
037:                this (msg, -1, -1);
038:            }
039:
040:            /**
041:             * Creates a new ParseException.
042:             * 
043:             * @param msg
044:             *        An error message.
045:             * @param lineNo
046:             *        A line number associated with the message.
047:             * @param columnNo
048:             *        A column number associated with the message.
049:             */
050:            public RDFParseException(String msg, int lineNo, int columnNo) {
051:                super (msg + getLocationString(lineNo, columnNo));
052:                this .lineNo = lineNo;
053:                this .columnNo = columnNo;
054:            }
055:
056:            /**
057:             * Creates a new ParseException wrapping another exception. The
058:             * ParseException will inherit its message from the supplied source
059:             * exception.
060:             * 
061:             * @param t
062:             *        The source exception.
063:             */
064:            public RDFParseException(Throwable t) {
065:                this (t, -1, -1);
066:            }
067:
068:            /**
069:             * Creates a new ParseException wrapping another exception. The
070:             * ParseException will inherit its message from the supplied source
071:             * exception.
072:             * 
073:             * @param t
074:             *        The source exception.
075:             * @param lineNo
076:             *        A line number associated with the message.
077:             * @param columnNo
078:             *        A column number associated with the message.
079:             */
080:            public RDFParseException(Throwable t, int lineNo, int columnNo) {
081:                super (t.getMessage() + getLocationString(lineNo, columnNo), t);
082:                this .lineNo = lineNo;
083:                this .columnNo = columnNo;
084:            }
085:
086:            /*---------*
087:             * Methods *
088:             *---------*/
089:
090:            /**
091:             * Gets the line number associated with this parse exception.
092:             * 
093:             * @return A line number, or -1 if no line number is available or applicable.
094:             */
095:            public int getLineNumber() {
096:                return lineNo;
097:            }
098:
099:            /**
100:             * Gets the column number associated with this parse exception.
101:             * 
102:             * @return A column number, or -1 if no column number is available or
103:             *         applicable.
104:             */
105:            public int getColumnNumber() {
106:                return columnNo;
107:            }
108:
109:            /**
110:             * Creates a string to that shows the specified line and column number.
111:             * Negative line numbers are interpreted as unknowns. Example output: "[line
112:             * 12, column 34]". If the specified line number is negative, this method
113:             * returns an empty string.
114:             */
115:            public static String getLocationString(int lineNo, int columnNo) {
116:                if (lineNo < 0) {
117:                    return "";
118:                }
119:
120:                StringBuilder sb = new StringBuilder(16);
121:                sb.append(" [line ");
122:                sb.append(lineNo);
123:
124:                if (columnNo >= 0) {
125:                    sb.append(", column ");
126:                    sb.append(columnNo);
127:                }
128:
129:                sb.append("]");
130:                return sb.toString();
131:            }
132:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.