/** * Determine whether this registry contains a custom editor * for the specified array/collection element. * @param elementType the target type of the element * (can be {@code null} if not known) * @param propertyPath the property path (typically of the array/collection; * can be {@code null} if not known) * @return whether a matching custom editor has been found */ public boolean hasCustomEditorForElement(@Nullable Class<?> elementType, @Nullable String propertyPath) { if (propertyPath != null && this.customEditorsForPath != null) { for (Map.Entry<String, CustomEditorHolder> entry : this.customEditorsForPath.entrySet()) { if (PropertyAccessorUtils.matchesProperty(entry.getKey(), propertyPath) && entry.getValue().getPropertyEditor(elementType) != null) { return true; } } } // No property-specific editor -> check type-specific editor. return (elementType != null && this.customEditors != null && this.customEditors.containsKey(elementType)); }
/** * Determine whether this registry contains a custom editor * for the specified array/collection element. * @param elementType the target type of the element * (can be {@code null} if not known) * @param propertyPath the property path (typically of the array/collection; * can be {@code null} if not known) * @return whether a matching custom editor has been found */ public boolean hasCustomEditorForElement(@Nullable Class<?> elementType, @Nullable String propertyPath) { if (propertyPath != null && this.customEditorsForPath != null) { for (Map.Entry<String, CustomEditorHolder> entry : this.customEditorsForPath.entrySet()) { if (PropertyAccessorUtils.matchesProperty(entry.getKey(), propertyPath) && entry.getValue().getPropertyEditor(elementType) != null) { return true; } } } // No property-specific editor -> check type-specific editor. return (elementType != null && this.customEditors != null && this.customEditors.containsKey(elementType)); }
/** * Determine whether this registry contains a custom editor * for the specified array/collection element. * @param elementType the target type of the element * (can be <code>null</code> if not known) * @param propertyPath the property path (typically of the array/collection; * can be <code>null</code> if not known) * @return whether a matching custom editor has been found */ public boolean hasCustomEditorForElement(Class<?> elementType, String propertyPath) { if (propertyPath != null && this.customEditorsForPath != null) { for (Map.Entry<String, CustomEditorHolder> entry : this.customEditorsForPath.entrySet()) { if (PropertyAccessorUtils.matchesProperty(entry.getKey(), propertyPath)) { if (entry.getValue().getPropertyEditor(elementType) != null) { return true; } } } } // No property-specific editor -> check type-specific editor. return (elementType != null && this.customEditors != null && this.customEditors.containsKey(elementType)); }
/** * Determine whether this registry contains a custom editor * for the specified array/collection element. * @param elementType the target type of the element * (can be {@code null} if not known) * @param propertyPath the property path (typically of the array/collection; * can be {@code null} if not known) * @return whether a matching custom editor has been found */ public boolean hasCustomEditorForElement(Class<?> elementType, String propertyPath) { if (propertyPath != null && this.customEditorsForPath != null) { for (Map.Entry<String, CustomEditorHolder> entry : this.customEditorsForPath.entrySet()) { if (PropertyAccessorUtils.matchesProperty(entry.getKey(), propertyPath)) { if (entry.getValue().getPropertyEditor(elementType) != null) { return true; } } } } // No property-specific editor -> check type-specific editor. return (elementType != null && this.customEditors != null && this.customEditors.containsKey(elementType)); }