/** * Walks up the type hierarchy of the feature returning all super types of the specified feature * type. The search terminates when a non-FeatureType or null is found. The original featureType * is not included as an ancestor, only its strict ancestors. */ public static List<FeatureType> getAncestors(FeatureType featureType) { List<FeatureType> ancestors = new ArrayList<FeatureType>(); while (featureType.getSuper() instanceof FeatureType) { FeatureType superType = (FeatureType) featureType.getSuper(); ancestors.add(superType); featureType = superType; } return ancestors; }
private FeatureType reprojectType(FeatureType type) { Collection<PropertyDescriptor> schema = new ArrayList<PropertyDescriptor>(); for (PropertyDescriptor descr : type.getDescriptors()) { if (descr instanceof GeometryDescriptor) { schema.add(reprojectGeometry((GeometryDescriptor) descr)); } else { schema.add(descr); } } FeatureType ft; if (type instanceof NonFeatureTypeProxy) { ft = new NonFeatureTypeProxy( ((NonFeatureTypeProxy) type).getSubject(), mapping, schema); } else { ft = ftf.createFeatureType( type.getName(), schema, reprojectGeometry(type.getGeometryDescriptor()), type.isAbstract(), type.getRestrictions(), type.getSuper(), type.getDescription()); } ft.getUserData().putAll(type.getUserData()); return ft; }
public AttributeType getSuper() { return delegate.getSuper(); }
/** * Walks up the type hierarchy of the feature returning all super types of the specified feature * type. The search terminates when a non-FeatureType or null is found. The original featureType * is not included as an ancestor, only its strict ancestors. */ public static List<FeatureType> getAncestors(FeatureType featureType) { List<FeatureType> ancestors = new ArrayList<FeatureType>(); while (featureType.getSuper() instanceof FeatureType) { FeatureType superType = (FeatureType) featureType.getSuper(); ancestors.add(superType); featureType = superType; } return ancestors; }
type.isAbstract(), type.getRestrictions(), type.getSuper(), type.getDescription()); newType.getUserData().putAll(type.getUserData());
private FeatureType reprojectType(FeatureType type) { Collection<PropertyDescriptor> schema = new ArrayList<PropertyDescriptor>(); for (PropertyDescriptor descr : type.getDescriptors()) { if (descr instanceof GeometryDescriptor) { schema.add(reprojectGeometry((GeometryDescriptor)descr)); } else { schema.add(descr); } } FeatureType ft = ftf.createFeatureType(type.getName(), schema, reprojectGeometry(type.getGeometryDescriptor()), type.isAbstract(), type.getRestrictions(), type.getSuper(), type.getDescription()); ft.getUserData().putAll(type.getUserData()); return ft; }
public FeatureType getFeatureType() { FeatureType ft = delegate.getFeatureType(); FeatureTypeFactory factory = new FeatureTypeFactoryImpl(); FeatureType gsft = factory.createFeatureType(new NameImpl(GS_NAMESPACE, "Record"), ft.getDescriptors(), null, false, null, ft.getSuper(), null); return gsft; }
Assert.assertNotNull(wq_plus_Type.getSuper()); typeName = Types.typeName(GML.NAMESPACE, GML.AbstractFeatureType.getLocalPart()); Assert.assertEquals(typeName, wq_plus_Type.getSuper().getName()); Assert.assertNotNull(wq_plus_Type.getDescriptors()); Assert.assertEquals(8, ((ComplexFeatureTypeImpl) wq_plus_Type).getTypeDescriptors().size());