Example usage for org.springframework.web.servlet.support BindStatus findEditor

List of usage examples for org.springframework.web.servlet.support BindStatus findEditor

Introduction

In this page you can find the example usage for org.springframework.web.servlet.support BindStatus findEditor.

Prototype

@Nullable
public PropertyEditor findEditor(Class<?> valueClass) 

Source Link

Document

Find a PropertyEditor for the given value class, associated with the property that this bound status is currently bound to.

Usage

From source file:org.hdiv.web.servlet.tags.form.SelectedValueComparatorHDIV.java

private static boolean exhaustiveCollectionCompare(Collection collection, Object candidateValue,
        BindStatus bindStatus) {

    Map<PropertyEditor, Object> convertedValueCache = new HashMap<PropertyEditor, Object>(1);
    PropertyEditor editor = null;
    boolean candidateIsString = (candidateValue instanceof String);
    if (!candidateIsString) {
        editor = bindStatus.findEditor(candidateValue.getClass());
    }//from   w w  w .j ava  2s . co m
    for (Object element : collection) {
        if (editor == null && element != null && candidateIsString) {
            editor = bindStatus.findEditor(element.getClass());
        }
        if (exhaustiveCompare(element, candidateValue, editor, convertedValueCache)) {
            return true;
        }
    }
    return false;
}