View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *  http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.any23.writer;
19  
20  import java.io.OutputStream;
21  
22  import org.apache.any23.configuration.Settings;
23  import org.eclipse.rdf4j.rio.RDFFormat;
24  
25  /**
26   * The superinterface of all {@link TripleHandler} factory interfaces.
27   * Do not implement this interface directly. Instead, implement one of the subinterfaces {@link TripleWriterFactory} or {@link DecoratingWriterFactory}.
28   * @author Peter Ansell (p_ansell@yahoo.com)
29   * @author Hans Brende (hansbrende@apache.org)
30   */
31  public interface WriterFactory {
32  
33      /**
34       * @deprecated since 2.3. Use {@link TripleWriterFactory#getTripleFormat()} instead.
35       */
36      @Deprecated
37      RDFFormat getRdfFormat();
38  
39      String getIdentifier();
40  
41      /**
42       * @deprecated since 2.3. Use {@link TripleWriterFactory#getTripleFormat()}.{@link TripleFormat#getMimeType() getMimeType()} instead.
43       */
44      @Deprecated
45      String getMimeType();
46  
47      /**
48       * @deprecated since 2.3. Use {@link TripleWriterFactory#getTripleWriter(OutputStream, Settings)} instead.
49       */
50      @Deprecated
51      FormatWriter getRdfWriter(OutputStream os);
52  }
53  
54  interface BaseWriterFactory<Output> extends WriterFactory {
55  
56      Settings getSupportedSettings();
57  
58      TripleHandler getTripleWriter(Output output, Settings settings);
59  
60      @Override
61      @Deprecated
62      default FormatWriter getRdfWriter(OutputStream os) {
63          throw new UnsupportedOperationException("this class does not support getRdfWriter()");
64      }
65  
66      @Override
67      @Deprecated
68      default String getMimeType() {
69          throw new UnsupportedOperationException("this class does not support getMimeType()");
70      }
71  
72      @Override
73      @Deprecated
74      default RDFFormat getRdfFormat() {
75          throw new UnsupportedOperationException("this class does not support getRdfFormat()");
76      }
77  }