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


001:        // SAX entity resolver.
002:        // No warranty; no copyright -- use this as you will.
003:        // $Id$
004:
005:        package org.xml.sax;
006:
007:        import java.io.IOException;
008:
009:        /**
010:         * Basic interface for resolving entities.
011:         *
012:         * <blockquote>
013:         * <em>This module, both source code and documentation, is in the
014:         * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
015:         * </blockquote>
016:         *
017:         * <p>If a SAX application needs to implement customized handling
018:         * for external entities, it must implement this interface and
019:         * register an instance with the SAX driver using the
020:         * {@link org.xml.sax.XMLReader#setEntityResolver setEntityResolver}
021:         * method.</p>
022:         *
023:         * <p>The XML reader will then allow the application to intercept any
024:         * external entities (including the external DTD subset and external
025:         * parameter entities, if any) before including them.</p>
026:         *
027:         * <p>Many SAX applications will not need to implement this interface,
028:         * but it will be especially useful for applications that build
029:         * XML documents from databases or other specialised input sources,
030:         * or for applications that use URI types other than URLs.</p>
031:         *
032:         * <p>The following resolver would provide the application
033:         * with a special character stream for the entity with the system
034:         * identifier "http://www.myhost.com/today":</p>
035:         *
036:         * <pre>
037:         * import org.xml.sax.EntityResolver;
038:         * import org.xml.sax.InputSource;
039:         *
040:         * public class MyResolver implements EntityResolver {
041:         *   public InputSource resolveEntity (String publicId, String systemId)
042:         *   {
043:         *     if (systemId.equals("http://www.myhost.com/today")) {
044:         *              // return a special input source
045:         *       MyReader reader = new MyReader();
046:         *       return new InputSource(reader);
047:         *     } else {
048:         *              // use the default behaviour
049:         *       return null;
050:         *     }
051:         *   }
052:         * }
053:         * </pre>
054:         *
055:         * <p>The application can also use this interface to redirect system
056:         * identifiers to local URIs or to look up replacements in a catalog
057:         * (possibly by using the public identifier).</p>
058:         *
059:         * @since SAX 1.0
060:         * @author David Megginson, 
061:         *         <a href="mailto:sax@megginson.com">sax@megginson.com</a>
062:         * @version 2.0
063:         * @see org.xml.sax.Parser#setEntityResolver
064:         * @see org.xml.sax.InputSource
065:         */
066:        public interface EntityResolver {
067:
068:            /**
069:             * Allow the application to resolve external entities.
070:             *
071:             * <p>The Parser will call this method before opening any external
072:             * entity except the top-level document entity (including the
073:             * external DTD subset, external entities referenced within the
074:             * DTD, and external entities referenced within the document
075:             * element): the application may request that the parser resolve
076:             * the entity itself, that it use an alternative URI, or that it
077:             * use an entirely different input source.</p>
078:             *
079:             * <p>Application writers can use this method to redirect external
080:             * system identifiers to secure and/or local URIs, to look up
081:             * public identifiers in a catalogue, or to read an entity from a
082:             * database or other input source (including, for example, a dialog
083:             * box).</p>
084:             *
085:             * <p>If the system identifier is a URL, the SAX parser must
086:             * resolve it fully before reporting it to the application.</p>
087:             *
088:             * @param publicId The public identifier of the external entity
089:             *        being referenced, or null if none was supplied.
090:             * @param systemId The system identifier of the external entity
091:             *        being referenced.
092:             * @return An InputSource object describing the new input source,
093:             *         or null to request that the parser open a regular
094:             *         URI connection to the system identifier.
095:             * @exception org.xml.sax.SAXException Any SAX exception, possibly
096:             *            wrapping another exception.
097:             * @exception java.io.IOException A Java-specific IO exception,
098:             *            possibly the result of creating a new InputStream
099:             *            or Reader for the InputSource.
100:             * @see org.xml.sax.InputSource
101:             */
102:            public abstract InputSource resolveEntity(String publicId,
103:                    String systemId) throws SAXException, IOException;
104:
105:        }
106:
107:        // end of EntityResolver.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.