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.query.resultio;
07:
08: import info.aduna.lang.service.FileFormatServiceRegistry;
09:
10: /**
11: * A registry that keeps track of the available
12: * {@link TupleQueryResultParserFactory}s.
13: *
14: * @author Arjohn Kampman
15: */
16: public class TupleQueryResultParserRegistry
17: extends
18: FileFormatServiceRegistry<TupleQueryResultFormat, TupleQueryResultParserFactory> {
19:
20: private static TupleQueryResultParserRegistry defaultRegistry;
21:
22: /**
23: * Gets the default TupleQueryResultParserRegistry.
24: *
25: * @return The default registry.
26: */
27: public static synchronized TupleQueryResultParserRegistry getInstance() {
28: if (defaultRegistry == null) {
29: defaultRegistry = new TupleQueryResultParserRegistry();
30: }
31:
32: return defaultRegistry;
33: }
34:
35: public TupleQueryResultParserRegistry() {
36: super (TupleQueryResultParserFactory.class);
37: }
38:
39: @Override
40: protected TupleQueryResultFormat getKey(
41: TupleQueryResultParserFactory factory) {
42: return factory.getTupleQueryResultFormat();
43: }
44: }
|