01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2005-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.data.complex;
17:
18: import java.io.IOException;
19: import java.util.HashMap;
20: import java.util.Map;
21:
22: import org.geotools.data.DataAccess;
23: import org.geotools.data.DataAccessFactory;
24: import org.geotools.data.feature.FeatureAccess;
25: import org.geotools.util.SimpleInternationalString;
26: import org.opengis.util.InternationalString;
27:
28: /**
29: * {@link DataAccessFactory} for the ComplexDataStore implementation.
30: *
31: * @author Gabriel Roldan, Axios Engineering
32: * @version $Id: ComplexDataAccessFactory.java 25814 2007-06-12 12:03:41Z groldan $
33: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/community-schemas/community-schema-ds/src/main/java/org/geotools/data/complex/ComplexDataAccessFactory.java $
34: * @since 2.4
35: */
36: public class ComplexDataAccessFactory extends ComplexDataStoreFactory
37: implements DataAccessFactory {
38:
39: public boolean canAccess(Object bean) {
40: if (!(bean instanceof Map)) {
41: return false;
42: }
43: return super .canProcess((Map) bean);
44: }
45:
46: public boolean canCreateContent(Object arg0) {
47: return false;
48: }
49:
50: public DataAccess createAccess(Object params) throws IOException {
51: FeatureAccess store = (FeatureAccess) super
52: .createDataStore((Map) params);
53: return store;
54: }
55:
56: public Object createAccessBean() {
57: return new HashMap();
58: }
59:
60: public DataAccess createContent(Object params) {
61: throw new UnsupportedOperationException();
62: }
63:
64: public Object createContentBean() {
65: return null;
66: }
67:
68: public InternationalString getName() {
69: return new SimpleInternationalString(super.getDisplayName());
70: }
71:
72: }
|