Source Code Cross Referenced for TidyMessage.java in  » HTML-Parser » JTidy » org » w3c » tidy » 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 » HTML Parser » JTidy » org.w3c.tidy 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Java HTML Tidy - JTidy
003:         *  HTML parser and pretty printer
004:         *
005:         *  Copyright (c) 1998-2000 World Wide Web Consortium (Massachusetts
006:         *  Institute of Technology, Institut National de Recherche en
007:         *  Informatique et en Automatique, Keio University). All Rights
008:         *  Reserved.
009:         *
010:         *  Contributing Author(s):
011:         *
012:         *     Dave Raggett <dsr@w3.org>
013:         *     Andy Quick <ac.quick@sympatico.ca> (translation to Java)
014:         *     Gary L Peskin <garyp@firstech.com> (Java development)
015:         *     Sami Lempinen <sami@lempinen.net> (release management)
016:         *     Fabrizio Giustina <fgiust at users.sourceforge.net>
017:         *
018:         *  The contributing author(s) would like to thank all those who
019:         *  helped with testing, bug fixes, and patience.  This wouldn't
020:         *  have been possible without all of you.
021:         *
022:         *  COPYRIGHT NOTICE:
023:         * 
024:         *  This software and documentation is provided "as is," and
025:         *  the copyright holders and contributing author(s) make no
026:         *  representations or warranties, express or implied, including
027:         *  but not limited to, warranties of merchantability or fitness
028:         *  for any particular purpose or that the use of the software or
029:         *  documentation will not infringe any third party patents,
030:         *  copyrights, trademarks or other rights. 
031:         *
032:         *  The copyright holders and contributing author(s) will not be
033:         *  liable for any direct, indirect, special or consequential damages
034:         *  arising out of any use of the software or documentation, even if
035:         *  advised of the possibility of such damage.
036:         *
037:         *  Permission is hereby granted to use, copy, modify, and distribute
038:         *  this source code, or portions hereof, documentation and executables,
039:         *  for any purpose, without fee, subject to the following restrictions:
040:         *
041:         *  1. The origin of this source code must not be misrepresented.
042:         *  2. Altered versions must be plainly marked as such and must
043:         *     not be misrepresented as being the original source.
044:         *  3. This Copyright notice may not be removed or altered from any
045:         *     source or altered source distribution.
046:         * 
047:         *  The copyright holders and contributing author(s) specifically
048:         *  permit, without fee, and encourage the use of this source code
049:         *  as a component for supporting the Hypertext Markup Language in
050:         *  commercial products. If you use this source code in a product,
051:         *  acknowledgment is not required but would be appreciated.
052:         *
053:         */
054:        package org.w3c.tidy;
055:
056:        /**
057:         * Message sent to listeners for validation errors/warnings and info.
058:         * @see Tidy#setMessageListener(TidyMessageListener)
059:         * @author Fabrizio Giustina
060:         * @version $Revision: 1.10 $ ($Author: fgiust $)
061:         */
062:        public final class TidyMessage {
063:
064:            /**
065:             * Line in the source file (can be 0 if the message is not related to a particular line, such as a summary message).
066:             */
067:            private int line;
068:
069:            /**
070:             * Column in the source file (can be 0 if the message is not related to a particular column, such as a summary
071:             * message).
072:             */
073:            private int column;
074:
075:            /**
076:             * Level for this message. Can be TidyMessage.Level.SUMMARY | TidyMessage.Level.INFO | TidyMessage.Level.WARNING |
077:             * TidyMessage.Level.ERROR.
078:             */
079:            private Level level;
080:
081:            /**
082:             * Formatted text for this message.
083:             */
084:            private String message;
085:
086:            /**
087:             * Tidy internal error code.
088:             */
089:            private int errorCode;
090:
091:            /**
092:             * Instantiates a new message.
093:             * @param errorCode Tidy internal error code.
094:             * @param line Line number in the source file
095:             * @param column Column number in the source file
096:             * @param level severity
097:             * @param message message text
098:             */
099:            public TidyMessage(int errorCode, int line, int column,
100:                    Level level, String message) {
101:                this .errorCode = errorCode;
102:                this .line = line;
103:                this .column = column;
104:                this .level = level;
105:                this .message = message;
106:            }
107:
108:            /**
109:             * Getter for <code>errorCode</code>.
110:             * @return Returns the errorCode.
111:             */
112:            public int getErrorCode() {
113:                return this .errorCode;
114:            }
115:
116:            /**
117:             * Getter for <code>column</code>.
118:             * @return Returns the column.
119:             */
120:            public int getColumn() {
121:                return this .column;
122:            }
123:
124:            /**
125:             * Getter for <code>level</code>.
126:             * @return Returns the level.
127:             */
128:            public Level getLevel() {
129:                return this .level;
130:            }
131:
132:            /**
133:             * Getter for <code>line</code>.
134:             * @return Returns the line.
135:             */
136:            public int getLine() {
137:                return this .line;
138:            }
139:
140:            /**
141:             * Getter for <code>message</code>.
142:             * @return Returns the message.
143:             */
144:            public String getMessage() {
145:                return this .message;
146:            }
147:
148:            /**
149:             * Message severity enumeration.
150:             * @author fgiust
151:             * @version $Revision: 1.10 $ ($Author: fgiust $)
152:             */
153:            public static final class Level implements  Comparable {
154:
155:                /**
156:                 * level = summary (0).
157:                 */
158:                public static final Level SUMMARY = new Level(0);
159:
160:                /**
161:                 * level = info (1).
162:                 */
163:                public static final Level INFO = new Level(1);
164:
165:                /**
166:                 * level = warning (2).
167:                 */
168:                public static final Level WARNING = new Level(2);
169:
170:                /**
171:                 * level = error (3).
172:                 */
173:                public static final Level ERROR = new Level(3);
174:
175:                /**
176:                 * short value for this level.
177:                 */
178:                private short code;
179:
180:                /**
181:                 * Instantiates a new message with the given code.
182:                 * @param code int value for this level
183:                 */
184:                private Level(int code) {
185:                    this .code = (short) code;
186:                }
187:
188:                /**
189:                 * Returns the int value for this level.
190:                 * @return int value for this level
191:                 */
192:                public short getCode() {
193:                    return this .code;
194:                }
195:
196:                /**
197:                 * Returns the Level instance corresponding to the given int value.
198:                 * @param code int value for the level
199:                 * @return Level instance
200:                 */
201:                public static Level fromCode(int code) {
202:                    switch (code) {
203:                    case 0:
204:                        return SUMMARY;
205:                    case 1:
206:                        return INFO;
207:                    case 2:
208:                        return WARNING;
209:                    case 3:
210:                        return ERROR;
211:
212:                    default:
213:                        return null;
214:                    }
215:                }
216:
217:                /**
218:                 * @see java.lang.Comparable#compareTo(Object)
219:                 */
220:                public int compareTo(Object object) {
221:                    return this .code - ((Level) object).code;
222:                }
223:
224:                /**
225:                 * @see java.lang.Object#equals(Object)
226:                 */
227:                public boolean equals(Object object) {
228:                    if (!(object instanceof  Level)) {
229:                        return false;
230:                    }
231:                    return this .code == ((Level) object).code;
232:                }
233:
234:                /**
235:                 * @see java.lang.Object#toString()
236:                 */
237:                public String toString() {
238:                    switch (code) {
239:                    case 0:
240:                        return "SUMMARY";
241:                    case 1:
242:                        return "INFO";
243:                    case 2:
244:                        return "WARNING";
245:                    case 3:
246:                        return "ERROR";
247:
248:                    default:
249:                        // should not happen
250:                        return "?";
251:                    }
252:                }
253:
254:                /**
255:                 * @see java.lang.Object#hashCode()
256:                 */
257:                public int hashCode() {
258:                    // new instances should not be created
259:                    return super.hashCode();
260:                }
261:            }
262:
263:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.