Source Code Cross Referenced for LexicalHandler.java in  » XML » Piccolo » org » xml » sax » ext » 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 » XML » Piccolo » org.xml.sax.ext 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // LexicalHandler.java - optional handler for lexical parse events.
002:        // http://www.saxproject.org
003:        // Public Domain: no warranty.
004:        // $Id: LexicalHandler.java,v 1.1.1.1 2002/05/03 23:29:41 yuvalo Exp $
005:
006:        package org.xml.sax.ext;
007:
008:        import org.xml.sax.SAXException;
009:
010:        /**
011:         * SAX2 extension handler for lexical events.
012:         *
013:         * <blockquote>
014:         * <em>This module, both source code and documentation, is in the
015:         * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
016:         * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
017:         * for further information.
018:         * </blockquote>
019:         *
020:         * <p>This is an optional extension handler for SAX2 to provide
021:         * lexical information about an XML document, such as comments
022:         * and CDATA section boundaries.
023:         * XML readers are not required to recognize this handler, and it
024:         * is not part of core-only SAX2 distributions.</p>
025:         *
026:         * <p>The events in the lexical handler apply to the entire document,
027:         * not just to the document element, and all lexical handler events
028:         * must appear between the content handler's startDocument and
029:         * endDocument events.</p>
030:         *
031:         * <p>To set the LexicalHandler for an XML reader, use the
032:         * {@link org.xml.sax.XMLReader#setProperty setProperty} method
033:         * with the property name
034:         * <code>http://xml.org/sax/properties/lexical-handler</code>
035:         * and an object implementing this interface (or null) as the value.
036:         * If the reader does not report lexical events, it will throw a
037:         * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException}
038:         * when you attempt to register the handler.</p>
039:         *
040:         * @since SAX 2.0 (extensions 1.0)
041:         * @author David Megginson
042:         * @version 2.0.1 (sax2r2)
043:         */
044:        public interface LexicalHandler {
045:
046:            /**
047:             * Report the start of DTD declarations, if any.
048:             *
049:             * <p>This method is intended to report the beginning of the
050:             * DOCTYPE declaration; if the document has no DOCTYPE declaration,
051:             * this method will not be invoked.</p>
052:             *
053:             * <p>All declarations reported through 
054:             * {@link org.xml.sax.DTDHandler DTDHandler} or
055:             * {@link org.xml.sax.ext.DeclHandler DeclHandler} events must appear
056:             * between the startDTD and {@link #endDTD endDTD} events.
057:             * Declarations are assumed to belong to the internal DTD subset
058:             * unless they appear between {@link #startEntity startEntity}
059:             * and {@link #endEntity endEntity} events.  Comments and
060:             * processing instructions from the DTD should also be reported
061:             * between the startDTD and endDTD events, in their original 
062:             * order of (logical) occurrence; they are not required to
063:             * appear in their correct locations relative to DTDHandler
064:             * or DeclHandler events, however.</p>
065:             *
066:             * <p>Note that the start/endDTD events will appear within
067:             * the start/endDocument events from ContentHandler and
068:             * before the first 
069:             * {@link org.xml.sax.ContentHandler#startElement startElement}
070:             * event.</p>
071:             *
072:             * @param name The document type name.
073:             * @param publicId The declared public identifier for the
074:             *        external DTD subset, or null if none was declared.
075:             * @param systemId The declared system identifier for the
076:             *        external DTD subset, or null if none was declared.
077:             *        (Note that this is not resolved against the document
078:             *        base URI.)
079:             * @exception SAXException The application may raise an
080:             *            exception.
081:             * @see #endDTD
082:             * @see #startEntity
083:             */
084:            public abstract void startDTD(String name, String publicId,
085:                    String systemId) throws SAXException;
086:
087:            /**
088:             * Report the end of DTD declarations.
089:             *
090:             * <p>This method is intended to report the end of the
091:             * DOCTYPE declaration; if the document has no DOCTYPE declaration,
092:             * this method will not be invoked.</p>
093:             *
094:             * @exception SAXException The application may raise an exception.
095:             * @see #startDTD
096:             */
097:            public abstract void endDTD() throws SAXException;
098:
099:            /**
100:             * Report the beginning of some internal and external XML entities.
101:             *
102:             * <p>The reporting of parameter entities (including
103:             * the external DTD subset) is optional, and SAX2 drivers that
104:             * report LexicalHandler events may not implement it; you can use the
105:             * <code
106:             * >http://xml.org/sax/features/lexical-handler/parameter-entities</code>
107:             * feature to query or control the reporting of parameter entities.</p>
108:             *
109:             * <p>General entities are reported with their regular names,
110:             * parameter entities have '%' prepended to their names, and 
111:             * the external DTD subset has the pseudo-entity name "[dtd]".</p>
112:             *
113:             * <p>When a SAX2 driver is providing these events, all other 
114:             * events must be properly nested within start/end entity 
115:             * events.  There is no additional requirement that events from 
116:             * {@link org.xml.sax.ext.DeclHandler DeclHandler} or
117:             * {@link org.xml.sax.DTDHandler DTDHandler} be properly ordered.</p>
118:             *
119:             * <p>Note that skipped entities will be reported through the
120:             * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity}
121:             * event, which is part of the ContentHandler interface.</p>
122:             *
123:             * <p>Because of the streaming event model that SAX uses, some
124:             * entity boundaries cannot be reported under any 
125:             * circumstances:</p>
126:             *
127:             * <ul>
128:             * <li>general entities within attribute values</li>
129:             * <li>parameter entities within declarations</li>
130:             * </ul>
131:             *
132:             * <p>These will be silently expanded, with no indication of where
133:             * the original entity boundaries were.</p>
134:             *
135:             * <p>Note also that the boundaries of character references (which
136:             * are not really entities anyway) are not reported.</p>
137:             *
138:             * <p>All start/endEntity events must be properly nested.
139:             *
140:             * @param name The name of the entity.  If it is a parameter
141:             *        entity, the name will begin with '%', and if it is the
142:             *        external DTD subset, it will be "[dtd]".
143:             * @exception SAXException The application may raise an exception.
144:             * @see #endEntity
145:             * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
146:             * @see org.xml.sax.ext.DeclHandler#externalEntityDecl 
147:             */
148:            public abstract void startEntity(String name) throws SAXException;
149:
150:            /**
151:             * Report the end of an entity.
152:             *
153:             * @param name The name of the entity that is ending.
154:             * @exception SAXException The application may raise an exception.
155:             * @see #startEntity
156:             */
157:            public abstract void endEntity(String name) throws SAXException;
158:
159:            /**
160:             * Report the start of a CDATA section.
161:             *
162:             * <p>The contents of the CDATA section will be reported through
163:             * the regular {@link org.xml.sax.ContentHandler#characters
164:             * characters} event; this event is intended only to report
165:             * the boundary.</p>
166:             *
167:             * @exception SAXException The application may raise an exception.
168:             * @see #endCDATA
169:             */
170:            public abstract void startCDATA() throws SAXException;
171:
172:            /**
173:             * Report the end of a CDATA section.
174:             *
175:             * @exception SAXException The application may raise an exception.
176:             * @see #startCDATA
177:             */
178:            public abstract void endCDATA() throws SAXException;
179:
180:            /**
181:             * Report an XML comment anywhere in the document.
182:             *
183:             * <p>This callback will be used for comments inside or outside the
184:             * document element, including comments in the external DTD
185:             * subset (if read).  Comments in the DTD must be properly
186:             * nested inside start/endDTD and start/endEntity events (if
187:             * used).</p>
188:             *
189:             * @param ch An array holding the characters in the comment.
190:             * @param start The starting position in the array.
191:             * @param length The number of characters to use from the array.
192:             * @exception SAXException The application may raise an exception.
193:             */
194:            public abstract void comment(char ch[], int start, int length)
195:                    throws SAXException;
196:
197:        }
198:
199:        // end of LexicalHandler.java
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.