01: package org.geotools.feature.iso.simple;
02:
03: import java.util.Collection;
04: import java.util.List;
05: import java.util.Set;
06:
07: import org.geotools.feature.iso.type.TypeFactoryImpl;
08: import org.opengis.feature.simple.SimpleFeatureCollectionType;
09: import org.opengis.feature.simple.SimpleFeatureType;
10: import org.opengis.feature.simple.SimpleTypeFactory;
11: import org.opengis.feature.type.AssociationDescriptor;
12: import org.opengis.feature.type.AttributeDescriptor;
13: import org.opengis.feature.type.AttributeType;
14: import org.opengis.feature.type.FeatureCollectionType;
15: import org.opengis.feature.type.FeatureType;
16: import org.opengis.feature.type.Name;
17: import org.opengis.filter.FilterFactory;
18: import org.opengis.referencing.crs.CRSFactory;
19: import org.opengis.referencing.crs.CoordinateReferenceSystem;
20: import org.opengis.util.InternationalString;
21:
22: /**
23: * This implementation is capable of creating a good default choice for
24: * capturing SimpleFeatureType, the focus is on corretness rather then
25: * efficiency or even strict error messages.
26: *
27: * @author Jody Garnett
28: */
29: public class SimpleTypeFactoryImpl extends TypeFactoryImpl implements
30: SimpleTypeFactory {
31:
32: public SimpleTypeFactoryImpl() {
33: super ();
34: }
35:
36: public SimpleTypeFactoryImpl(CRSFactory crsFactory,
37: FilterFactory filterFactory) {
38: super (crsFactory, filterFactory);
39: }
40:
41: public FeatureType createFeatureType(Name name, Collection schema,
42: AttributeDescriptor defaultGeometry,
43: CoordinateReferenceSystem crs, boolean isAbstract,
44: Set restrictions, AttributeType super Type,
45: InternationalString description) {
46: return new SimpleFeatureTypeImpl(name, schema, defaultGeometry,
47: crs, restrictions, description);
48: }
49:
50: public FeatureCollectionType createFeatureCollectionType(Name name,
51: Collection properties, Collection members,
52: AttributeDescriptor defaultGeom,
53: CoordinateReferenceSystem crs, boolean isAbstract,
54: Set restrictions, AttributeType super Type,
55: InternationalString description) {
56: return new SimpleFeatureCollectionTypeImpl(name,
57: (AssociationDescriptor) members.iterator().next(),
58: restrictions, description);
59: }
60:
61: public SimpleFeatureType createSimpleFeatureType(Name name,
62: List types, AttributeDescriptor defaultGeometry,
63: CoordinateReferenceSystem crs, Set restrictions,
64: InternationalString description) {
65:
66: return new SimpleFeatureTypeImpl(name, types, defaultGeometry,
67: crs, restrictions, description);
68: }
69:
70: public SimpleFeatureCollectionType createSimpleFeatureCollectionType(
71: Name name, SimpleFeatureType member,
72: InternationalString description) {
73: return new SimpleFeatureCollectionTypeImpl(name, member,
74: description);
75: }
76:
77: }
|