Source Code Cross Referenced for EntityDeclarationImpl.java in  » XML » stax-utils » javanet » staxutils » 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 » stax utils » javanet.staxutils 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* $Id: EntityDeclarationImpl.java,v 1.1 2004/06/21 18:59:45 ryan_shoemaker Exp $
002:         *
003:         * Copyright (c) 2004, Sun Microsystems, Inc.
004:         * All rights reserved.
005:         *
006:         * Redistribution and use in source and binary forms, with or without
007:         * modification, are permitted provided that the following conditions are
008:         * met:
009:         *
010:         *     * Redistributions of source code must retain the above copyright
011:         *      notice, this list of conditions and the following disclaimer.
012:         *
013:         *     * Redistributions in binary form must reproduce the above
014:         *      copyright notice, this list of conditions and the following
015:         *       disclaimer in the documentation and/or other materials provided
016:         *       with the distribution.
017:         *
018:         *     * Neither the name of Sun Microsystems, Inc. nor the names of its
019:         *       contributors may be used to endorse or promote products derived
020:         *       from this software without specific prior written permission.
021:         *
022:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
023:         * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
024:         * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
025:         * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
026:         * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
027:         * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
028:         * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
029:         * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
030:         * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
031:         * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
032:         * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
033:         */
034:        package javanet.staxutils;
035:
036:        import javax.xml.stream.Location;
037:        import javax.xml.stream.XMLStreamException;
038:        import javax.xml.stream.events.EntityDeclaration;
039:        import java.io.IOException;
040:        import java.io.Writer;
041:
042:        /**
043:         * Implementation of {@link javax.xml.stream.events.EntityDeclaration}.
044:         *
045:         * The only reason this class exists is because {@link javax.xml.stream.XMLEventFactory}
046:         * doesn't have a factory for this event type and the {@link ContentHandlerToXMLEventWriter}
047:         * needs to create one of these event types to handle skippedEntity events.
048:         *
049:         * @author Ryan.Shoemaker@Sun.COM
050:         * @version 1.0
051:         */
052:        class EntityDeclarationImpl extends EventHelper implements 
053:                EntityDeclaration {
054:
055:            private final String entityName;
056:            private final String publicId;
057:            private final String systemId;
058:            private final String notationName;
059:            private final String replacementText;
060:
061:            public EntityDeclarationImpl(Location location, String entityName,
062:                    String publicId, String systemId, String notationName,
063:                    String replacementText) {
064:                super (location);
065:                this .entityName = entityName;
066:                this .publicId = publicId;
067:                this .systemId = systemId;
068:                this .notationName = notationName;
069:                this .replacementText = replacementText;
070:            }
071:
072:            public String getBaseURI() {
073:                // TODO: ??
074:                return null;
075:            }
076:
077:            public String getName() {
078:                return entityName;
079:            }
080:
081:            public String getNotationName() {
082:                return notationName;
083:            }
084:
085:            public String getPublicId() {
086:                return publicId;
087:            }
088:
089:            public String getReplacementText() {
090:                return replacementText;
091:            }
092:
093:            public String getSystemId() {
094:                return systemId;
095:            }
096:
097:            public int getEventType() {
098:                return ENTITY_DECLARATION;
099:            }
100:
101:            public boolean isEntityReference() {
102:                return true;
103:            }
104:
105:            public void writeAsEncodedUnicode(Writer w)
106:                    throws XMLStreamException {
107:                try {
108:                    w.write('&');
109:                    w.write(entityName);
110:                    w.write(';');
111:                } catch (IOException ie) {
112:                    throw new XMLStreamException(ie);
113:                }
114:            }
115:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.