View Javadoc
1   /*
2    * Copyright 2009 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *     
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.openehealth.ipf.commons.xml;
17  
18  import java.io.InputStream;
19  import java.io.Reader;
20  
21  import org.w3c.dom.ls.LSInput;
22  
23  /**
24   * This class represents an input source for XML parser
25   * 
26   * @author Ferry Syafei Sapei
27   */
28  class LSInputImpl implements LSInput {
29  
30      private String baseURI;
31  
32      private InputStream byteStream;
33  
34      private boolean certifiedText;
35  
36      private Reader characterStream;
37  
38      private String encoding;
39  
40      private String publicId;
41  
42      private String stringData;
43  
44      private String systemId;
45  
46      public LSInputImpl(InputStream byteStream) {
47          this.byteStream = byteStream;
48      }
49  
50      @Override
51      public String getBaseURI() {
52          return baseURI;
53      }
54  
55      @Override
56      public InputStream getByteStream() {
57          return byteStream;
58      }
59  
60      @Override
61      public boolean getCertifiedText() {
62          return certifiedText;
63      }
64  
65      @Override
66      public Reader getCharacterStream() {
67          return characterStream;
68      }
69  
70      @Override
71      public String getEncoding() {
72          return encoding;
73      }
74  
75      @Override
76      public String getPublicId() {
77          return publicId;
78      }
79  
80      @Override
81      public String getStringData() {
82          return stringData;
83      }
84  
85      @Override
86      public String getSystemId() {
87          return systemId;
88      }
89  
90      @Override
91      public void setBaseURI(String baseURI) {
92          this.baseURI = baseURI;
93      }
94  
95      @Override
96      public void setByteStream(InputStream byteStream) {
97          this.byteStream = byteStream;
98      }
99  
100     @Override
101     public void setCertifiedText(boolean certifiedText) {
102         this.certifiedText = certifiedText;
103     }
104 
105     @Override
106     public void setCharacterStream(Reader characterStream) {
107         this.characterStream = characterStream;
108     }
109 
110     @Override
111     public void setEncoding(String encoding) {
112         this.encoding = encoding;
113     }
114 
115     @Override
116     public void setPublicId(String publicId) {
117         this.publicId = publicId;
118     }
119 
120     @Override
121     public void setStringData(String stringData) {
122         this.stringData = stringData;
123     }
124 
125     @Override
126     public void setSystemId(String systemId) {
127         this.systemId = systemId;
128     }
129 }