|
| 1 | +/* |
| 2 | + * Copyright 2013 (c) MuleSoft, Inc. |
| 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, |
| 11 | + * software distributed under the License is distributed on an |
| 12 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, |
| 13 | + * either express or implied. See the License for the specific |
| 14 | + * language governing permissions and limitations under the License. |
| 15 | + */ |
| 16 | +package org.raml.parser.rule; |
| 17 | + |
| 18 | +import java.io.ByteArrayInputStream; |
| 19 | +import java.io.InputStream; |
| 20 | +import java.io.Reader; |
| 21 | + |
| 22 | +import org.w3c.dom.ls.LSInput; |
| 23 | + |
| 24 | +public class LSInputImpl implements LSInput |
| 25 | +{ |
| 26 | + |
| 27 | + protected Reader characterStream; |
| 28 | + protected InputStream byteStream; |
| 29 | + protected String stringData; |
| 30 | + |
| 31 | + protected String systemId; |
| 32 | + protected String publicId; |
| 33 | + protected String baseUri; |
| 34 | + |
| 35 | + protected String encoding; |
| 36 | + protected boolean certifiedText; |
| 37 | + |
| 38 | + public LSInputImpl(String publicId, String systemId, String baseURI, ByteArrayInputStream content, String encoding) |
| 39 | + { |
| 40 | + this.publicId = publicId; |
| 41 | + this.systemId = systemId; |
| 42 | + this.baseUri = baseURI; |
| 43 | + this.byteStream = content; |
| 44 | + this.encoding = encoding; |
| 45 | + } |
| 46 | + |
| 47 | + @Override |
| 48 | + public Reader getCharacterStream() |
| 49 | + { |
| 50 | + return characterStream; |
| 51 | + } |
| 52 | + |
| 53 | + @Override |
| 54 | + public void setCharacterStream(Reader characterStream) |
| 55 | + { |
| 56 | + this.characterStream = characterStream; |
| 57 | + } |
| 58 | + |
| 59 | + @Override |
| 60 | + public InputStream getByteStream() |
| 61 | + { |
| 62 | + return byteStream; |
| 63 | + } |
| 64 | + |
| 65 | + @Override |
| 66 | + public void setByteStream(InputStream byteStream) |
| 67 | + { |
| 68 | + this.byteStream = byteStream; |
| 69 | + } |
| 70 | + |
| 71 | + @Override |
| 72 | + public String getStringData() |
| 73 | + { |
| 74 | + return stringData; |
| 75 | + } |
| 76 | + |
| 77 | + @Override |
| 78 | + public void setStringData(String stringData) |
| 79 | + { |
| 80 | + this.stringData = stringData; |
| 81 | + } |
| 82 | + |
| 83 | + @Override |
| 84 | + public String getSystemId() |
| 85 | + { |
| 86 | + return systemId; |
| 87 | + } |
| 88 | + |
| 89 | + @Override |
| 90 | + public void setSystemId(String systemId) |
| 91 | + { |
| 92 | + this.systemId = systemId; |
| 93 | + } |
| 94 | + |
| 95 | + @Override |
| 96 | + public String getPublicId() |
| 97 | + { |
| 98 | + return publicId; |
| 99 | + } |
| 100 | + |
| 101 | + @Override |
| 102 | + public void setPublicId(String publicId) |
| 103 | + { |
| 104 | + this.publicId = publicId; |
| 105 | + } |
| 106 | + |
| 107 | + @Override |
| 108 | + public String getBaseURI() |
| 109 | + { |
| 110 | + return baseUri; |
| 111 | + } |
| 112 | + |
| 113 | + @Override |
| 114 | + public void setBaseURI(String baseURI) |
| 115 | + { |
| 116 | + this.baseUri = baseURI; |
| 117 | + } |
| 118 | + |
| 119 | + @Override |
| 120 | + public String getEncoding() |
| 121 | + { |
| 122 | + return encoding; |
| 123 | + } |
| 124 | + |
| 125 | + @Override |
| 126 | + public void setEncoding(String encoding) |
| 127 | + { |
| 128 | + this.encoding = encoding; |
| 129 | + } |
| 130 | + |
| 131 | + @Override |
| 132 | + public boolean getCertifiedText() |
| 133 | + { |
| 134 | + return certifiedText; |
| 135 | + } |
| 136 | + |
| 137 | + @Override |
| 138 | + public void setCertifiedText(boolean certifiedText) |
| 139 | + { |
| 140 | + this.certifiedText = certifiedText; |
| 141 | + } |
| 142 | +} |
0 commit comments