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 RDFParserFactory}s.
12: *
13: * @author Arjohn Kampman
14: */
15: public class RDFParserRegistry extends
16: FileFormatServiceRegistry<RDFFormat, RDFParserFactory> {
17:
18: private static RDFParserRegistry defaultRegistry;
19:
20: /**
21: * Gets the default RDFParserRegistry.
22: *
23: * @return The default registry.
24: */
25: public static synchronized RDFParserRegistry getInstance() {
26: if (defaultRegistry == null) {
27: defaultRegistry = new RDFParserRegistry();
28: }
29:
30: return defaultRegistry;
31: }
32:
33: public RDFParserRegistry() {
34: super (RDFParserFactory.class);
35: }
36:
37: @Override
38: protected RDFFormat getKey(RDFParserFactory factory) {
39: return factory.getRDFFormat();
40: }
41: }
|