Source Code Cross Referenced for AttrCheckImpl.java in  » IDE-Netbeans » visualweb.api.designer » 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 » IDE Netbeans » visualweb.api.designer » org.w3c.tidy 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * @(#)AttrCheckImpl.java   1.11 2000/08/16
003:         *
004:         */
005:
006:        package org.w3c.tidy;
007:
008:        /**
009:         *
010:         * Check attribute values implementations
011:         *
012:         * (c) 1998-2000 (W3C) MIT, INRIA, Keio University
013:         * See Tidy.java for the copyright notice.
014:         * Derived from <a href="http://www.w3.org/People/Raggett/tidy">
015:         * HTML Tidy Release 4 Aug 2000</a>
016:         *
017:         * @author  Dave Raggett <dsr@w3.org>
018:         * @author  Andy Quick <ac.quick@sympatico.ca> (translation to Java)
019:         * @version 1.0, 1999/05/22
020:         * @version 1.0.1, 1999/05/29
021:         * @version 1.1, 1999/06/18 Java Bean
022:         * @version 1.2, 1999/07/10 Tidy Release 7 Jul 1999
023:         * @version 1.3, 1999/07/30 Tidy Release 26 Jul 1999
024:         * @version 1.4, 1999/09/04 DOM support
025:         * @version 1.5, 1999/10/23 Tidy Release 27 Sep 1999
026:         * @version 1.6, 1999/11/01 Tidy Release 22 Oct 1999
027:         * @version 1.7, 1999/12/06 Tidy Release 30 Nov 1999
028:         * @version 1.8, 2000/01/22 Tidy Release 13 Jan 2000
029:         * @version 1.9, 2000/06/03 Tidy Release 30 Apr 2000
030:         * @version 1.10, 2000/07/22 Tidy Release 8 Jul 2000
031:         * @version 1.11, 2000/08/16 Tidy Release 4 Aug 2000
032:         */
033:
034:        public class AttrCheckImpl {
035:
036:            public static class CheckUrl implements  AttrCheck {
037:
038:                public void check(Lexer lexer, Node node, AttVal attval) {
039:                    if (attval.value == null)
040:                        Report.attrError(lexer, node, attval.attribute,
041:                                Report.MISSING_ATTR_VALUE);
042:                    else if (lexer.configuration.FixBackslash) {
043:                        attval.value = attval.value.replace('\\', '/');
044:                    }
045:                }
046:
047:            };
048:
049:            public static class CheckScript implements  AttrCheck {
050:
051:                public void check(Lexer lexer, Node node, AttVal attval) {
052:                }
053:
054:            };
055:
056:            public static class CheckAlign implements  AttrCheck {
057:
058:                public void check(Lexer lexer, Node node, AttVal attval) {
059:                    String value;
060:
061:                    /* IMG, OBJECT, APPLET and EMBED use align for vertical position */
062:                    if (node.tag != null
063:                            && ((node.tag.model & Dict.CM_IMG) != 0)) {
064:                        getCheckValign().check(lexer, node, attval);
065:                        return;
066:                    }
067:
068:                    value = attval.value;
069:
070:                    if (value == null)
071:                        Report.attrError(lexer, node, attval.attribute,
072:                                Report.MISSING_ATTR_VALUE);
073:                    else if (!(Lexer.wstrcasecmp(value, "left") == 0
074:                            || Lexer.wstrcasecmp(value, "center") == 0
075:                            || Lexer.wstrcasecmp(value, "right") == 0 || Lexer
076:                            .wstrcasecmp(value, "justify") == 0))
077:                        Report.attrError(lexer, node, attval.value,
078:                                Report.BAD_ATTRIBUTE_VALUE);
079:                }
080:
081:            };
082:
083:            public static class CheckValign implements  AttrCheck {
084:
085:                public void check(Lexer lexer, Node node, AttVal attval) {
086:                    String value;
087:
088:                    value = attval.value;
089:
090:                    if (value == null)
091:                        Report.attrError(lexer, node, attval.attribute,
092:                                Report.MISSING_ATTR_VALUE);
093:                    else if (Lexer.wstrcasecmp(value, "top") == 0
094:                            || Lexer.wstrcasecmp(value, "middle") == 0
095:                            || Lexer.wstrcasecmp(value, "bottom") == 0
096:                            || Lexer.wstrcasecmp(value, "baseline") == 0) {
097:                        /* all is fine */
098:                    } else if (Lexer.wstrcasecmp(value, "left") == 0
099:                            || Lexer.wstrcasecmp(value, "right") == 0) {
100:                        if (!(node.tag != null && ((node.tag.model & Dict.CM_IMG) != 0)))
101:                            Report.attrError(lexer, node, value,
102:                                    Report.BAD_ATTRIBUTE_VALUE);
103:                    } else if (Lexer.wstrcasecmp(value, "texttop") == 0
104:                            || Lexer.wstrcasecmp(value, "absmiddle") == 0
105:                            || Lexer.wstrcasecmp(value, "absbottom") == 0
106:                            || Lexer.wstrcasecmp(value, "textbottom") == 0) {
107:                        lexer.versions &= Dict.VERS_PROPRIETARY;
108:                        Report.attrError(lexer, node, value,
109:                                Report.PROPRIETARY_ATTR_VALUE);
110:                    } else
111:                        Report.attrError(lexer, node, value,
112:                                Report.BAD_ATTRIBUTE_VALUE);
113:                }
114:
115:            };
116:
117:            public static class CheckBool implements  AttrCheck {
118:
119:                public void check(Lexer lexer, Node node, AttVal attval) {
120:                }
121:
122:            };
123:
124:            public static class CheckId implements  AttrCheck {
125:
126:                public void check(Lexer lexer, Node node, AttVal attval) {
127:                }
128:
129:            };
130:
131:            public static class CheckName implements  AttrCheck {
132:
133:                public void check(Lexer lexer, Node node, AttVal attval) {
134:                }
135:
136:            };
137:
138:            public static AttrCheck getCheckUrl() {
139:                return _checkUrl;
140:            }
141:
142:            public static AttrCheck getCheckScript() {
143:                return _checkScript;
144:            }
145:
146:            public static AttrCheck getCheckAlign() {
147:                return _checkAlign;
148:            }
149:
150:            public static AttrCheck getCheckValign() {
151:                return _checkValign;
152:            }
153:
154:            public static AttrCheck getCheckBool() {
155:                return _checkBool;
156:            }
157:
158:            public static AttrCheck getCheckId() {
159:                return _checkId;
160:            }
161:
162:            public static AttrCheck getCheckName() {
163:                return _checkName;
164:            }
165:
166:            private static AttrCheck _checkUrl = new CheckUrl();
167:            private static AttrCheck _checkScript = new CheckScript();
168:            private static AttrCheck _checkAlign = new CheckAlign();
169:            private static AttrCheck _checkValign = new CheckValign();
170:            private static AttrCheck _checkBool = new CheckBool();
171:            private static AttrCheck _checkId = new CheckId();
172:            private static AttrCheck _checkName = new CheckName();
173:
174:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.