Source Code Cross Referenced for URISyntaxException.java in  » Portal » Open-Portal » com » sun » portal » rewriter » util » uri » 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 » Portal » Open Portal » com.sun.portal.rewriter.util.uri 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * @(#)URISyntaxException.java	1.3 01/12/03
003:         *
004:         * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
005:         * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
006:         */
007:
008:        package com.sun.portal.rewriter.util.uri;
009:
010:        /**
011:         * Checked exception thrown to indicate that a string could not be parsed as a
012:         * URI reference.
013:         *
014:         * @author Mark Reinhold
015:         * @version 1.3, 01/12/03
016:         * @see URI
017:         */
018:
019:        public class URISyntaxException extends Exception {
020:            private String input;
021:            private int index;
022:
023:            /**
024:             * Constructs an instance from the given input string, reason, and error
025:             * index.
026:             *
027:             * @param  input   The input string
028:             * @param  reason  A string explaining why the input could not be parsed
029:             * @param  index   The index at which the parse error occurred,
030:             *                 or <tt>-1</tt> if the index is not known
031:             *
032:             * @throws  NullPointerException
033:             *          If either the input or reason strings are <tt>null</tt>
034:             *
035:             * @throws  IllegalArgumentException
036:             *          If the error index is less than <tt>-1</tt>
037:             */
038:            public URISyntaxException(final String input, final String reason,
039:                    final int index) {
040:                super (reason);
041:                if ((input == null) || (reason == null))
042:                    throw new NullPointerException();
043:                if (index < -1)
044:                    throw new IllegalArgumentException();
045:                this .input = input;
046:                this .index = index;
047:            }
048:
049:            /**
050:             * Constructs an instance from the given input string and reason.  The
051:             * resulting object will have an error index of <tt>-1</tt>.
052:             *
053:             * @param  input   The input string
054:             * @param  reason  A string explaining why the input could not be parsed
055:             *
056:             * @throws  NullPointerException
057:             *          If either the input or reason strings are <tt>null</tt>
058:             */
059:            public URISyntaxException(final String input, final String reason) {
060:                this (input, reason, -1);
061:            }
062:
063:            /**
064:             * Returns the input string.
065:             *
066:             * @return  The input string
067:             */
068:            public String getInput() {
069:                return input;
070:            }
071:
072:            /**
073:             * Returns a string explaining why the input string could not be parsed.
074:             *
075:             * @return  The reason string
076:             */
077:            public String getReason() {
078:                return super .getMessage();
079:            }
080:
081:            /**
082:             * Returns an index into the input string of the position at which the
083:             * parse error occurred, or <tt>-1</tt> if this position is not known.
084:             *
085:             * @return  The error index
086:             */
087:            public int getIndex() {
088:                return index;
089:            }
090:
091:            /**
092:             * Returns a string describing the parse error.  The resulting string
093:             * consists of the reason string followed by a colon character
094:             * (<tt>':'</tt>), a space, and the input string.  If the error index is
095:             * defined then the string <tt>" at index "</tt> followed by the index, in
096:             * decimal, is inserted after the reason string and before the colon
097:             * character.
098:             *
099:             * @return  A string describing the parse error
100:             */
101:            public String getMessage() {
102:                final StringBuffer sb = new StringBuffer();
103:                sb.append(getReason());
104:                if (index > -1) {
105:                    sb.append(" at index ");
106:                    sb.append(index);
107:                }
108:                sb.append(": ");
109:                sb.append(input);
110:                return sb.toString();
111:            }
112:
113:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.