public void registerCustomEditors(PropertyEditorRegistry registry) { if (!(registry instanceof PropertyEditorRegistrySupport)) { throw new IllegalArgumentException("Cannot registered shared editor " + "on non-PropertyEditorRegistrySupport registry: " + registry); } ((PropertyEditorRegistrySupport) registry).registerSharedEditor(this.requiredType, this.sharedEditor); } }