001: package org.ontoware.semversion.impl;
002:
003: import java.io.IOException;
004: import java.io.InputStream;
005: import java.io.Reader;
006: import java.util.Iterator;
007:
008: import org.ontoware.rdf2go.exception.ModelRuntimeException;
009: import org.ontoware.rdf2go.model.Diff;
010: import org.ontoware.rdf2go.model.Model;
011: import org.ontoware.rdf2go.model.Statement;
012: import org.ontoware.rdf2go.model.Syntax;
013: import org.ontoware.rdf2go.model.TriplePattern;
014: import org.ontoware.rdf2go.model.impl.DelegatingModel;
015: import org.ontoware.rdf2go.model.node.BlankNode;
016: import org.ontoware.rdf2go.model.node.DatatypeLiteral;
017: import org.ontoware.rdf2go.model.node.LanguageTagLiteral;
018: import org.ontoware.rdf2go.model.node.Node;
019: import org.ontoware.rdf2go.model.node.NodeOrVariable;
020: import org.ontoware.rdf2go.model.node.PlainLiteral;
021: import org.ontoware.rdf2go.model.node.Resource;
022: import org.ontoware.rdf2go.model.node.ResourceOrVariable;
023: import org.ontoware.rdf2go.model.node.URI;
024: import org.ontoware.rdf2go.model.node.UriOrVariable;
025:
026: /**
027: * Wraps a model into a read-only model
028: *
029: * @author voelkel
030: *
031: */
032: public class ReadOnlyModelLayer extends DelegatingModel implements
033: Model {
034:
035: public ReadOnlyModelLayer(Model model) {
036: super (model);
037: }
038:
039: public void setProperty(URI propertyURI, Object value) {
040: throw new UnsupportedOperationException(
041: "This is a read-only model");
042: }
043:
044: public BlankNode createBlankNode() {
045: throw new UnsupportedOperationException(
046: "This is a read-only model");
047: }
048:
049: public DatatypeLiteral createDatatypeLiteral(String literal,
050: URI datatypeURI) throws ModelRuntimeException {
051: throw new UnsupportedOperationException(
052: "This is a read-only model");
053: }
054:
055: public LanguageTagLiteral createLanguageTagLiteral(String literal,
056: String langugeTag) throws ModelRuntimeException {
057: throw new UnsupportedOperationException(
058: "This is a read-only model");
059: }
060:
061: public PlainLiteral createPlainLiteral(String literal) {
062: throw new UnsupportedOperationException(
063: "This is a read-only model");
064: }
065:
066: public Statement createStatement(Resource subject, URI predicate,
067: Node object) {
068: throw new UnsupportedOperationException(
069: "This is a read-only model");
070:
071: }
072:
073: public URI createURI(String uriString) throws ModelRuntimeException {
074: throw new UnsupportedOperationException(
075: "This is a read-only model");
076:
077: }
078:
079: public URI newRandomUniqueURI() {
080: throw new UnsupportedOperationException(
081: "This is a read-only model");
082: }
083:
084: public void removeAll() throws ModelRuntimeException {
085: throw new UnsupportedOperationException(
086: "This is a read-only model");
087: }
088:
089: public void removeAll(Iterator<? extends Statement> statements)
090: throws ModelRuntimeException {
091: throw new UnsupportedOperationException(
092: "This is a read-only model");
093: }
094:
095: public void removeStatement(Statement statement)
096: throws ModelRuntimeException {
097: throw new UnsupportedOperationException(
098: "This is a read-only model");
099:
100: }
101:
102: public void removeStatement(Resource subject, URI predicate,
103: Node object) throws ModelRuntimeException {
104: throw new UnsupportedOperationException(
105: "This is a read-only model");
106:
107: }
108:
109: public void removeStatement(Resource subject, URI predicate,
110: String literal) throws ModelRuntimeException {
111: throw new UnsupportedOperationException(
112: "This is a read-only model");
113:
114: }
115:
116: public void removeStatement(String subjectURIString, URI predicate,
117: String literal) throws ModelRuntimeException {
118: throw new UnsupportedOperationException(
119: "This is a read-only model");
120:
121: }
122:
123: public void removeStatement(Resource subject, URI predicate,
124: String literal, String languageTag)
125: throws ModelRuntimeException {
126: throw new UnsupportedOperationException(
127: "This is a read-only model");
128:
129: }
130:
131: public void removeStatement(Resource subject, URI predicate,
132: String literal, URI datatypeURI)
133: throws ModelRuntimeException {
134: throw new UnsupportedOperationException(
135: "This is a read-only model");
136:
137: }
138:
139: public void removeStatement(String subjectURIString, URI predicate,
140: String literal, String languageTag)
141: throws ModelRuntimeException {
142: throw new UnsupportedOperationException(
143: "This is a read-only model");
144:
145: }
146:
147: public void removeStatement(String subjectURIString, URI predicate,
148: String literal, URI datatypeURI)
149: throws ModelRuntimeException {
150: throw new UnsupportedOperationException(
151: "This is a read-only model");
152:
153: }
154:
155: public void update(Diff diff) throws ModelRuntimeException {
156: throw new UnsupportedOperationException(
157: "This is a read-only model");
158:
159: }
160:
161: public void addAll(Iterator<? extends Statement> other)
162: throws ModelRuntimeException {
163: throw new UnsupportedOperationException(
164: "This is a read-only model");
165:
166: }
167:
168: public void addStatement(Statement statement)
169: throws ModelRuntimeException {
170: throw new UnsupportedOperationException(
171: "This is a read-only model");
172:
173: }
174:
175: public void addStatement(Resource subject, URI predicate,
176: Node object) throws ModelRuntimeException {
177: throw new UnsupportedOperationException(
178: "This is a read-only model");
179:
180: }
181:
182: public void addStatement(Resource subject, URI predicate,
183: String literal) throws ModelRuntimeException {
184: throw new UnsupportedOperationException(
185: "This is a read-only model");
186:
187: }
188:
189: public void addStatement(String subjectURIString, URI predicate,
190: String literal) throws ModelRuntimeException {
191: throw new UnsupportedOperationException(
192: "This is a read-only model");
193:
194: }
195:
196: public void addStatement(Resource subject, URI predicate,
197: String literal, String languageTag)
198: throws ModelRuntimeException {
199: throw new UnsupportedOperationException(
200: "This is a read-only model");
201:
202: }
203:
204: public void addStatement(Resource subject, URI predicate,
205: String literal, URI datatypeURI)
206: throws ModelRuntimeException {
207: throw new UnsupportedOperationException(
208: "This is a read-only model");
209:
210: }
211:
212: public void addStatement(String subjectURIString, URI predicate,
213: String literal, String languageTag)
214: throws ModelRuntimeException {
215: throw new UnsupportedOperationException(
216: "This is a read-only model");
217:
218: }
219:
220: public void addStatement(String subjectURIString, URI predicate,
221: String literal, URI datatypeURI)
222: throws ModelRuntimeException {
223: throw new UnsupportedOperationException(
224: "This is a read-only model");
225:
226: }
227:
228: public void removeStatements(TriplePattern triplePattern)
229: throws ModelRuntimeException {
230: throw new UnsupportedOperationException(
231: "This is a read-only model");
232:
233: }
234:
235: public void removeStatements(ResourceOrVariable subject,
236: UriOrVariable predicate, NodeOrVariable object)
237: throws ModelRuntimeException {
238: throw new UnsupportedOperationException(
239: "This is a read-only model");
240:
241: }
242:
243: public TriplePattern createTriplePattern(
244: ResourceOrVariable subject, UriOrVariable predicate,
245: NodeOrVariable object) {
246: throw new UnsupportedOperationException(
247: "This is a read-only model");
248:
249: }
250:
251: public void readFrom(Reader in) throws IOException,
252: ModelRuntimeException {
253: throw new UnsupportedOperationException(
254: "This is a read-only model");
255:
256: }
257:
258: public void readFrom(InputStream in) throws IOException,
259: ModelRuntimeException {
260: throw new UnsupportedOperationException(
261: "This is a read-only model");
262:
263: }
264:
265: public void readFrom(Reader in, Syntax syntax) throws IOException,
266: ModelRuntimeException {
267: throw new UnsupportedOperationException(
268: "This is a read-only model");
269:
270: }
271:
272: public void readFrom(InputStream reader, Syntax syntax)
273: throws IOException, ModelRuntimeException {
274: throw new UnsupportedOperationException(
275: "This is a read-only model");
276:
277: }
278:
279: }
|