Source Code Cross Referenced for ParserFactory.java in  » Web-Server » Rimfaxe-Web-Server » org » xml » sax » helpers » 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 » Web Server » Rimfaxe Web Server » org.xml.sax.helpers 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // SAX parser factory.
002:        // http://www.saxproject.org
003:        // No warranty; no copyright -- use this as you will.
004:        // $Id: ParserFactory.java,v 1.7 2002/02/01 20:06:20 db Exp $
005:
006:        package org.xml.sax.helpers;
007:
008:        import java.lang.ClassNotFoundException;
009:        import java.lang.IllegalAccessException;
010:        import java.lang.InstantiationException;
011:        import java.lang.SecurityException;
012:        import java.lang.ClassCastException;
013:
014:        import org.xml.sax.Parser;
015:
016:        /**
017:         * Java-specific class for dynamically loading SAX parsers.
018:         *
019:         * <blockquote>
020:         * <em>This module, both source code and documentation, is in the
021:         * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
022:         * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
023:         * for further information.
024:         * </blockquote>
025:         *
026:         * <p><strong>Note:</strong> This class is designed to work with the now-deprecated
027:         * SAX1 {@link org.xml.sax.Parser Parser} class.  SAX2 applications should use
028:         * {@link org.xml.sax.helpers.XMLReaderFactory XMLReaderFactory} instead.</p>
029:         *
030:         * <p>ParserFactory is not part of the platform-independent definition
031:         * of SAX; it is an additional convenience class designed
032:         * specifically for Java XML application writers.  SAX applications
033:         * can use the static methods in this class to allocate a SAX parser
034:         * dynamically at run-time based either on the value of the
035:         * `org.xml.sax.parser' system property or on a string containing the class
036:         * name.</p>
037:         *
038:         * <p>Note that the application still requires an XML parser that
039:         * implements SAX1.</p>
040:         *
041:         * @deprecated This class works with the deprecated
042:         *             {@link org.xml.sax.Parser Parser}
043:         *             interface.
044:         * @since SAX 1.0
045:         * @author David Megginson
046:         * @version 2.0.1 (sax2r2)
047:         */
048:        public class ParserFactory {
049:
050:            /**
051:             * Private null constructor.
052:             */
053:            private ParserFactory() {
054:            }
055:
056:            /**
057:             * Create a new SAX parser using the `org.xml.sax.parser' system property.
058:             *
059:             * <p>The named class must exist and must implement the
060:             * {@link org.xml.sax.Parser Parser} interface.</p>
061:             *
062:             * @exception java.lang.NullPointerException There is no value
063:             *            for the `org.xml.sax.parser' system property.
064:             * @exception java.lang.ClassNotFoundException The SAX parser
065:             *            class was not found (check your CLASSPATH).
066:             * @exception IllegalAccessException The SAX parser class was
067:             *            found, but you do not have permission to load
068:             *            it.
069:             * @exception InstantiationException The SAX parser class was
070:             *            found but could not be instantiated.
071:             * @exception java.lang.ClassCastException The SAX parser class
072:             *            was found and instantiated, but does not implement
073:             *            org.xml.sax.Parser.
074:             * @see #makeParser(java.lang.String)
075:             * @see org.xml.sax.Parser
076:             */
077:            public static Parser makeParser() throws ClassNotFoundException,
078:                    IllegalAccessException, InstantiationException,
079:                    NullPointerException, ClassCastException {
080:                String className = System.getProperty("org.xml.sax.parser");
081:                if (className == null) {
082:                    throw new NullPointerException(
083:                            "No value for sax.parser property");
084:                } else {
085:                    return makeParser(className);
086:                }
087:            }
088:
089:            /**
090:             * Create a new SAX parser object using the class name provided.
091:             *
092:             * <p>The named class must exist and must implement the
093:             * {@link org.xml.sax.Parser Parser} interface.</p>
094:             *
095:             * @param className A string containing the name of the
096:             *                  SAX parser class.
097:             * @exception java.lang.ClassNotFoundException The SAX parser
098:             *            class was not found (check your CLASSPATH).
099:             * @exception IllegalAccessException The SAX parser class was
100:             *            found, but you do not have permission to load
101:             *            it.
102:             * @exception InstantiationException The SAX parser class was
103:             *            found but could not be instantiated.
104:             * @exception java.lang.ClassCastException The SAX parser class
105:             *            was found and instantiated, but does not implement
106:             *            org.xml.sax.Parser.
107:             * @see #makeParser()
108:             * @see org.xml.sax.Parser
109:             */
110:            public static Parser makeParser(String className)
111:                    throws ClassNotFoundException, IllegalAccessException,
112:                    InstantiationException, ClassCastException {
113:                return (Parser) NewInstance.newInstance(NewInstance
114:                        .getClassLoader(), className);
115:            }
116:
117:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.