final SimpleFeatureType featureType ) {
if (featureType.getGeometryDescriptor() == null) {
throw new UnsupportedOperationException(
"Schema modification not supported");
}
final FeatureDataAdapter oldAdaptor = getAdapter(typeName);
final SimpleFeatureType oldFeatureType = oldAdaptor.getType();
for (final AttributeDescriptor descriptor : oldFeatureType.getAttributeDescriptors()) {
final AttributeDescriptor newDescriptor = featureType.getDescriptor(descriptor.getLocalName());
if ((newDescriptor == null) || !newDescriptor.getType().equals(
descriptor.getType())) {
throw new UnsupportedOperationException(
"Removal or changing the type of schema attributes is not supported");
}
}
final FeatureDataAdapter adapter = new FeatureDataAdapter(
featureType,
getVisibilityManagement());
adapterStore.addAdapter(adapter);
}