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