001: /*
002: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.tools.internal.xjc.reader.xmlschema.parser;
027:
028: import java.io.InputStream;
029: import java.io.Reader;
030:
031: import org.w3c.dom.ls.LSInput;
032: import org.xml.sax.InputSource;
033:
034: /**
035: * LSInput implementation that wraps a SAX InputSource
036: *
037: * @author Ryan.Shoemaker@Sun.COM
038: */
039: public class LSInputSAXWrapper implements LSInput {
040: private InputSource core;
041:
042: public LSInputSAXWrapper(InputSource inputSource) {
043: assert inputSource != null;
044: core = inputSource;
045: }
046:
047: public Reader getCharacterStream() {
048: return core.getCharacterStream();
049: }
050:
051: public void setCharacterStream(Reader characterStream) {
052: core.setCharacterStream(characterStream);
053: }
054:
055: public InputStream getByteStream() {
056: return core.getByteStream();
057: }
058:
059: public void setByteStream(InputStream byteStream) {
060: core.setByteStream(byteStream);
061: }
062:
063: public String getStringData() {
064: return null;
065: }
066:
067: public void setStringData(String stringData) {
068: // no-op
069: }
070:
071: public String getSystemId() {
072: return core.getSystemId();
073: }
074:
075: public void setSystemId(String systemId) {
076: core.setSystemId(systemId);
077: }
078:
079: public String getPublicId() {
080: return core.getPublicId();
081: }
082:
083: public void setPublicId(String publicId) {
084: core.setPublicId(publicId);
085: }
086:
087: public String getBaseURI() {
088: return null;
089: }
090:
091: public void setBaseURI(String baseURI) {
092: // no-op
093: }
094:
095: public String getEncoding() {
096: return core.getEncoding();
097: }
098:
099: public void setEncoding(String encoding) {
100: core.setEncoding(encoding);
101: }
102:
103: public boolean getCertifiedText() {
104: return true;
105: }
106:
107: public void setCertifiedText(boolean certifiedText) {
108: // no-op
109: }
110: }
|