Source Code Cross Referenced for XMLInputSource.java in  » XML » xerces-2_9_1 » org » apache » xerces » xni » parser » 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.xni.parser 
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.xni.parser;
019:
020:        import org.apache.xerces.xni.XMLResourceIdentifier;
021:
022:        import java.io.InputStream;
023:        import java.io.Reader;
024:
025:        /**
026:         * This class represents an input source for an XML document. The
027:         * basic properties of an input source are the following:
028:         * <ul>
029:         *  <li>public identifier</li>
030:         *  <li>system identifier</li>
031:         *  <li>byte stream or character stream</li>
032:         *  <li>
033:         * </ul>
034:         *
035:         * @author Andy Clark, IBM
036:         *
037:         * @version $Id: XMLInputSource.java 447244 2006-09-18 05:20:40Z mrglavas $
038:         */
039:        public class XMLInputSource {
040:
041:            //
042:            // Data
043:            //
044:
045:            /** Public identifier. */
046:            protected String fPublicId;
047:
048:            /** System identifier. */
049:            protected String fSystemId;
050:
051:            /** Base system identifier. */
052:            protected String fBaseSystemId;
053:
054:            /** Byte stream. */
055:            protected InputStream fByteStream;
056:
057:            /** Character stream. */
058:            protected Reader fCharStream;
059:
060:            /** Encoding. */
061:            protected String fEncoding;
062:
063:            //
064:            // Constructors
065:            //
066:
067:            /** 
068:             * Constructs an input source from just the public and system
069:             * identifiers, leaving resolution of the entity and opening of
070:             * the input stream up to the caller.
071:             *
072:             * @param publicId     The public identifier, if known.
073:             * @param systemId     The system identifier. This value should
074:             *                     always be set, if possible, and can be
075:             *                     relative or absolute. If the system identifier
076:             *                     is relative, then the base system identifier
077:             *                     should be set.
078:             * @param baseSystemId The base system identifier. This value should
079:             *                     always be set to the fully expanded URI of the
080:             *                     base system identifier, if possible.
081:             */
082:            public XMLInputSource(String publicId, String systemId,
083:                    String baseSystemId) {
084:                fPublicId = publicId;
085:                fSystemId = systemId;
086:                fBaseSystemId = baseSystemId;
087:            } // <init>(String,String,String)
088:
089:            /** 
090:             * Constructs an input source from a XMLResourceIdentifier
091:             * object, leaving resolution of the entity and opening of
092:             * the input stream up to the caller.
093:             *
094:             * @param resourceIdentifier    the XMLResourceIdentifier containing the information
095:             */
096:            public XMLInputSource(XMLResourceIdentifier resourceIdentifier) {
097:
098:                fPublicId = resourceIdentifier.getPublicId();
099:                fSystemId = resourceIdentifier.getLiteralSystemId();
100:                fBaseSystemId = resourceIdentifier.getBaseSystemId();
101:            } // <init>(XMLResourceIdentifier)
102:
103:            /**
104:             * Constructs an input source from a byte stream.
105:             *
106:             * @param publicId     The public identifier, if known.
107:             * @param systemId     The system identifier. This value should
108:             *                     always be set, if possible, and can be
109:             *                     relative or absolute. If the system identifier
110:             *                     is relative, then the base system identifier
111:             *                     should be set.
112:             * @param baseSystemId The base system identifier. This value should
113:             *                     always be set to the fully expanded URI of the
114:             *                     base system identifier, if possible.
115:             * @param byteStream   The byte stream.
116:             * @param encoding     The encoding of the byte stream, if known.
117:             */
118:            public XMLInputSource(String publicId, String systemId,
119:                    String baseSystemId, InputStream byteStream, String encoding) {
120:                fPublicId = publicId;
121:                fSystemId = systemId;
122:                fBaseSystemId = baseSystemId;
123:                fByteStream = byteStream;
124:                fEncoding = encoding;
125:            } // <init>(String,String,String,InputStream,String)
126:
127:            /**
128:             * Constructs an input source from a character stream.
129:             *
130:             * @param publicId     The public identifier, if known.
131:             * @param systemId     The system identifier. This value should
132:             *                     always be set, if possible, and can be
133:             *                     relative or absolute. If the system identifier
134:             *                     is relative, then the base system identifier
135:             *                     should be set.
136:             * @param baseSystemId The base system identifier. This value should
137:             *                     always be set to the fully expanded URI of the
138:             *                     base system identifier, if possible.
139:             * @param charStream   The character stream.
140:             * @param encoding     The original encoding of the byte stream
141:             *                     used by the reader, if known.
142:             */
143:            public XMLInputSource(String publicId, String systemId,
144:                    String baseSystemId, Reader charStream, String encoding) {
145:                fPublicId = publicId;
146:                fSystemId = systemId;
147:                fBaseSystemId = baseSystemId;
148:                fCharStream = charStream;
149:                fEncoding = encoding;
150:            } // <init>(String,String,String,Reader,String)
151:
152:            //
153:            // Public methods
154:            //
155:
156:            /** 
157:             * Sets the public identifier. 
158:             *
159:             * @param publicId The new public identifier.
160:             */
161:            public void setPublicId(String publicId) {
162:                fPublicId = publicId;
163:            } // setPublicId(String)
164:
165:            /** Returns the public identifier. */
166:            public String getPublicId() {
167:                return fPublicId;
168:            } // getPublicId():String
169:
170:            /** 
171:             * Sets the system identifier. 
172:             *
173:             * @param systemId The new system identifier.
174:             */
175:            public void setSystemId(String systemId) {
176:                fSystemId = systemId;
177:            } // setSystemId(String)
178:
179:            /** Returns the system identifier. */
180:            public String getSystemId() {
181:                return fSystemId;
182:            } // getSystemId():String
183:
184:            /** 
185:             * Sets the base system identifier. 
186:             *
187:             * @param baseSystemId The new base system identifier.
188:             */
189:            public void setBaseSystemId(String baseSystemId) {
190:                fBaseSystemId = baseSystemId;
191:            } // setBaseSystemId(String)
192:
193:            /** Returns the base system identifier. */
194:            public String getBaseSystemId() {
195:                return fBaseSystemId;
196:            } // getBaseSystemId():String
197:
198:            /**
199:             * Sets the byte stream. If the byte stream is not already opened
200:             * when this object is instantiated, then the code that opens the
201:             * stream should also set the byte stream on this object. Also, if
202:             * the encoding is auto-detected, then the encoding should also be
203:             * set on this object.
204:             *
205:             * @param byteStream The new byte stream.
206:             */
207:            public void setByteStream(InputStream byteStream) {
208:                fByteStream = byteStream;
209:            } // setByteStream(InputSource)
210:
211:            /** Returns the byte stream. */
212:            public InputStream getByteStream() {
213:                return fByteStream;
214:            } // getByteStream():InputStream
215:
216:            /**
217:             * Sets the character stream. If the character stream is not already
218:             * opened when this object is instantiated, then the code that opens 
219:             * the stream should also set the character stream on this object. 
220:             * Also, the encoding of the byte stream used by the reader should 
221:             * also be set on this object, if known.
222:             *
223:             * @param charStream The new character stream.
224:             *
225:             * @see #setEncoding
226:             */
227:            public void setCharacterStream(Reader charStream) {
228:                fCharStream = charStream;
229:            } // setCharacterStream(Reader)
230:
231:            /** Returns the character stream. */
232:            public Reader getCharacterStream() {
233:                return fCharStream;
234:            } // getCharacterStream():Reader
235:
236:            /**
237:             * Sets the encoding of the stream.
238:             *
239:             * @param encoding The new encoding.
240:             */
241:            public void setEncoding(String encoding) {
242:                fEncoding = encoding;
243:            } // setEncoding(String)
244:
245:            /** Returns the encoding of the stream, or null if not known. */
246:            public String getEncoding() {
247:                return fEncoding;
248:            } // getEncoding():String
249:
250:        } // class XMLInputSource
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.