Source Code Cross Referenced for DOMOutputImpl.java in  » XML » xerces-2_9_1 » org » apache » xerces » dom » 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 » xerces 2_9_1 » org.apache.xerces.dom 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:
018:        package org.apache.xerces.dom;
019:
020:        import org.w3c.dom.ls.LSOutput;
021:
022:        import java.io.Writer;
023:        import java.io.OutputStream;
024:
025:        /**
026:         * This class represents an output destination for data.
027:         * This interface allows an application to encapsulate information about an
028:         * output destination in a single object, which may include a URI, a byte stream
029:         * (possibly with a specifiedencoding), a base URI, and/or a character stream.
030:         * The exact definitions of a byte stream and a character stream are binding
031:         * dependent.
032:         * The application is expected to provide objects that implement this interface
033:         * whenever such objects are needed. The application can either provide its
034:         * own objects that implement this interface, or it can use the generic factory
035:         * method DOMImplementationLS.createLSOutput() to create objects that
036:         * implement this interface.
037:         * The DOMSerializer will use the LSOutput object to determine where to
038:         * serialize the output to. The DOMSerializer will look at the different
039:         * outputs specified in the LSOutput in the following order to know which one
040:         * to output to, the first one that data can be output to will be used:
041:         * 1.LSOutput.characterStream
042:         * 2.LSOutput.byteStream
043:         * 3.LSOutput.systemId
044:         * LSOutput objects belong to the application. The DOM implementation will
045:         * never modify them (though it may make copies and modify the copies,
046:         * if necessary).
047:         *
048:         * @xerces.internal
049:         *
050:         * @author Arun Yadav, Sun Microsytems
051:         * @author Gopal Sharma, Sun Microsystems
052:         **/
053:
054:        public class DOMOutputImpl implements  LSOutput {
055:
056:            protected Writer fCharStream = null;
057:            protected OutputStream fByteStream = null;
058:            protected String fSystemId = null;
059:            protected String fEncoding = null;
060:
061:            /**
062:             * Default Constructor
063:             */
064:            public DOMOutputImpl() {
065:            }
066:
067:            /**
068:             * An attribute of a language and binding dependent type that represents a
069:             * writable stream of bytes. If the application knows the character encoding
070:             * of the byte stream, it should set the encoding attribute. Setting the
071:             * encoding in this way will override any encoding specified in an XML
072:             * declaration in the data.
073:             */
074:
075:            public Writer getCharacterStream() {
076:                return fCharStream;
077:            };
078:
079:            /**
080:             * An attribute of a language and binding dependent type that represents a
081:             * writable stream of bytes. If the application knows the character encoding
082:             * of the byte stream, it should set the encoding attribute. Setting the
083:             * encoding in this way will override any encoding specified in an XML
084:             * declaration in the data.
085:             */
086:
087:            public void setCharacterStream(Writer characterStream) {
088:                fCharStream = characterStream;
089:            };
090:
091:            /**
092:             * Depending on the language binding in use, this attribute may not be
093:             * available. An attribute of a language and binding dependent type that
094:             * represents a writable stream to which 16-bit units can be output. The
095:             * application must encode the stream using UTF-16 (defined in [Unicode] and
096:             *  Amendment 1 of [ISO/IEC 10646]).
097:             */
098:
099:            public OutputStream getByteStream() {
100:                return fByteStream;
101:            };
102:
103:            /**
104:             * Depending on the language binding in use, this attribute may not be
105:             * available. An attribute of a language and binding dependent type that
106:             * represents a writable stream to which 16-bit units can be output. The
107:             * application must encode the stream using UTF-16 (defined in [Unicode] and
108:             *  Amendment 1 of [ISO/IEC 10646]).
109:             */
110:
111:            public void setByteStream(OutputStream byteStream) {
112:                fByteStream = byteStream;
113:            };
114:
115:            /**
116:             * The system identifier, a URI reference [IETF RFC 2396], for this output
117:             *  destination. If the application knows the character encoding of the
118:             *  object pointed to by the system identifier, it can set the encoding
119:             *  using the encoding attribute. If the system ID is a relative URI
120:             *  reference (see section 5 in [IETF RFC 2396]), the behavior is
121:             *  implementation dependent.
122:             */
123:
124:            public String getSystemId() {
125:                return fSystemId;
126:            };
127:
128:            /**
129:             * The system identifier, a URI reference [IETF RFC 2396], for this output
130:             *  destination. If the application knows the character encoding of the
131:             *  object pointed to by the system identifier, it can set the encoding
132:             *  using the encoding attribute. If the system ID is a relative URI
133:             *  reference (see section 5 in [IETF RFC 2396]), the behavior is
134:             *  implementation dependent.
135:             */
136:
137:            public void setSystemId(String systemId) {
138:                fSystemId = systemId;
139:            };
140:
141:            /**
142:             * The character encoding, if known. The encoding must be a string
143:             * acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3
144:             * "Character Encoding in Entities"). This attribute has no effect when the
145:             * application provides a character stream or string data. For other sources
146:             * of input, an encoding specified by means of this attribute will override
147:             * any encoding specified in the XML declaration or the Text declaration, or
148:             * an encoding obtained from a higher level protocol, such as HTTP
149:             * [IETF RFC 2616].
150:             */
151:
152:            public String getEncoding() {
153:                return fEncoding;
154:            };
155:
156:            /**
157:             * The character encoding, if known. The encoding must be a string
158:             * acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3
159:             * "Character Encoding in Entities"). This attribute has no effect when the
160:             * application provides a character stream or string data. For other sources
161:             * of input, an encoding specified by means of this attribute will override
162:             * any encoding specified in the XML declaration or the Text declaration, or
163:             * an encoding obtained from a higher level protocol, such as HTTP
164:             * [IETF RFC 2616].
165:             */
166:
167:            public void setEncoding(String encoding) {
168:                fEncoding = encoding;
169:            };
170:
171:        }//DOMOutputImpl
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.