01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.rio;
07:
08: import info.aduna.lang.service.FileFormatServiceRegistry;
09:
10: /**
11: * A registry that keeps track of the available {@link RDFWriterFactory}s.
12: *
13: * @author Arjohn Kampman
14: */
15: public class RDFWriterRegistry extends
16: FileFormatServiceRegistry<RDFFormat, RDFWriterFactory> {
17:
18: private static RDFWriterRegistry defaultRegistry;
19:
20: /**
21: * Gets the default RDFWriterRegistry.
22: *
23: * @return The default registry.
24: */
25: public static synchronized RDFWriterRegistry getInstance() {
26: if (defaultRegistry == null) {
27: defaultRegistry = new RDFWriterRegistry();
28: }
29:
30: return defaultRegistry;
31: }
32:
33: public RDFWriterRegistry() {
34: super (RDFWriterFactory.class);
35: }
36:
37: @Override
38: protected RDFFormat getKey(RDFWriterFactory factory) {
39: return factory.getRDFFormat();
40: }
41: }
|