001package org.hl7.fhir.utilities;
002/*
003Copyright (c) 2011+, HL7, Inc
004All rights reserved.
005
006Redistribution and use in source and binary forms, with or without modification, 
007are permitted provided that the following conditions are met:
008
009 * Redistributions of source code must retain the above copyright notice, this 
010   list of conditions and the following disclaimer.
011 * Redistributions in binary form must reproduce the above copyright notice, 
012   this list of conditions and the following disclaimer in the documentation 
013   and/or other materials provided with the distribution.
014 * Neither the name of HL7 nor the names of its contributors may be used to 
015   endorse or promote products derived from this software without specific 
016   prior written permission.
017
018THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
019ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
020WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
021IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
022INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
023NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
024PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
025WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
026ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
027POSSIBILITY OF SUCH DAMAGE.
028
029*/
030
031import java.io.InputStream;
032import java.io.Reader;
033
034import org.w3c.dom.ls.LSInput;
035
036public class SchemaInputSource implements LSInput {
037
038        private InputStream stream;
039  private String publicId;
040  private String systemId;
041  private String namespaceURI;
042
043        public SchemaInputSource(InputStream inputStream, String publicId, String systemId, String namespaceURI) {
044                this.stream = inputStream;
045                this.publicId = publicId;
046                this.systemId = systemId;
047                this.namespaceURI = namespaceURI;
048        }
049
050        @Override
051        public String getBaseURI() {
052          return namespaceURI;
053        }
054
055        @Override
056        public InputStream getByteStream() {
057                return stream;
058        }
059
060        @Override
061        public boolean getCertifiedText() {
062    throw new Error("Not implemented yet");
063        }
064
065        @Override
066        public Reader getCharacterStream() {
067    return null;
068        }
069
070        @Override
071        public String getEncoding() {
072    return "UTF-8";
073        }
074
075        @Override
076        public String getPublicId() {
077    return publicId;
078        }
079
080        @Override
081        public String getStringData() {
082    return null;
083        }
084
085        @Override
086        public String getSystemId() {
087    return systemId;
088        }
089
090        @Override
091        public void setBaseURI(String baseURI) {
092    throw new Error("Not implemented yet");
093        }
094
095        @Override
096        public void setByteStream(InputStream byteStream) {
097    throw new Error("Not implemented yet");
098        }
099
100        @Override
101        public void setCertifiedText(boolean certifiedText) {
102    throw new Error("Not implemented yet");
103        }
104
105        @Override
106        public void setCharacterStream(Reader characterStream) {
107    throw new Error("Not implemented yet");
108        }
109
110        @Override
111        public void setEncoding(String encoding) {
112    throw new Error("Not implemented yet");
113        }
114
115        @Override
116        public void setPublicId(String publicId) {
117    throw new Error("Not implemented yet");
118        }
119
120        @Override
121        public void setStringData(String stringData) {
122    throw new Error("Not implemented yet");
123        }
124
125        @Override
126        public void setSystemId(String systemId) {
127    throw new Error("Not implemented yet");
128        }
129}