Source Code Cross Referenced for REException.java in  » Template-Engine » JDynamiTe » gnu » regexp » 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 » Template Engine » JDynamiTe » gnu.regexp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  gnu/regexp/REException.java
003:         *  Copyright (C) 1998 Wes Biggs
004:         *
005:         *  This library is free software; you can redistribute it and/or modify
006:         *  it under the terms of the GNU Library General Public License as published
007:         *  by the Free Software Foundation; either version 2 of the License, or
008:         *  (at your option) any later version.
009:         *
010:         *  This library is distributed in the hope that it will be useful,
011:         *  but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013:         *  GNU Library General Public License for more details.
014:         *
015:         *  You should have received a copy of the GNU Library General Public License
016:         *  along with this program; if not, write to the Free Software
017:         *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
018:         */
019:
020:        package gnu.regexp;
021:
022:        /**
023:         * This is the regular expression exception class.  An exception of this type
024:         * defines the three attributes:
025:         * <OL>
026:         * <LI> A descriptive message of the error.
027:         * <LI> An integral type code equivalent to one of the statically
028:         *      defined symbols listed below.
029:         * <LI> The approximate position in the input string where the error
030:         *      occurred.
031:         * </OL>
032:         *
033:         * @author <A HREF="mailto:wes@cacas.org">Wes Biggs</A>
034:         */
035:
036:        public class REException extends Exception {
037:            private int m_type;
038:            private int m_pos;
039:
040:            // Error conditions from GNU regcomp(3) manual
041:
042:            /**
043:             * Error flag.
044:             * Invalid use of repetition operators such  as  using
045:             * `*' as the first character.
046:             */
047:            public static final int REG_BADRPT = 1;
048:
049:            /**
050:             * Error flag.
051:             * Invalid use of back reference operator.
052:             */
053:            public static final int REG_BADBR = 2;
054:
055:            /**
056:             * Error flag.
057:             * Un-matched brace interval operators.
058:             */
059:            public static final int REG_EBRACE = 3;
060:
061:            /**
062:             * Error flag.
063:             * Un-matched bracket list operators.
064:             */
065:            public static final int REG_EBRACK = 4;
066:
067:            /**
068:             * Error flag.
069:             * Invalid  use  of the range operator, eg. the ending
070:             * point of the range occurs  prior  to  the  starting
071:             * point.
072:             */
073:            public static final int REG_ERANGE = 5;
074:
075:            /**
076:             * Error flag.
077:             * Unknown character class name. <B>Not implemented</B>.
078:             */
079:            public static final int REG_ECTYPE = 6;
080:
081:            /**
082:             * Error flag.
083:             * Un-matched parenthesis group operators.
084:             */
085:            public static final int REG_EPAREN = 7;
086:
087:            /**
088:             * Error flag.
089:             * Invalid back reference to a subexpression.
090:             */
091:            public static final int REG_ESUBREG = 8;
092:
093:            /**
094:             * Error flag.
095:             * Non specific error. <B>Not implemented</B>.
096:             */
097:            public static final int REG_EEND = 9;
098:
099:            /**
100:             * Error flag.
101:             * Invalid escape sequence. <B>Not implemented</B>.
102:             */
103:            public static final int REG_ESCAPE = 10;
104:
105:            /**
106:             * Error flag.
107:             * Invalid  use  of pattern operators such as group or list.
108:             */
109:            public static final int REG_BADPAT = 11;
110:
111:            /**
112:             * Error flag.
113:             * Compiled  regular  expression  requires  a  pattern
114:             * buffer larger than 64Kb. <B>Not implemented</B>.
115:             */
116:            public static final int REG_ESIZE = 12;
117:
118:            /**
119:             * Error flag.
120:             * The regex routines ran out of memory. <B>Not implemented</B>.
121:             */
122:            public static final int REG_ESPACE = 13;
123:
124:            REException(String msg, int type, int position) {
125:                super (msg);
126:                m_type = type;
127:                m_pos = position;
128:            }
129:
130:            /**
131:             * Returns the type of the exception, one of the constants listed above.
132:             */
133:
134:            public int getType() {
135:                return m_type;
136:            }
137:
138:            /**
139:             * Returns the position, relative to the string or character array being
140:             * compiled, where the error occurred.  This position is generally the point
141:             * where the error was detected, not necessarily the starting index of
142:             * a bad subexpression.
143:             */
144:            public int getPosition() {
145:                return m_pos;
146:            }
147:
148:            /**
149:             * Reports the descriptive message associated with this exception
150:             * as well as its index position in the string or character array
151:             * being compiled.
152:             */
153:            public String getMessage() {
154:                StringBuffer sb = new StringBuffer();
155:                sb.append("At position " + m_pos
156:                        + " in regular expression pattern: ");
157:                sb.append('\n');
158:                sb.append(super.getMessage());
159:                return sb.toString();
160:            }
161:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.