Tabnine Logo
AbstractPropertyBindingResult.getCustomEditor
Code IndexAdd Tabnine to your IDE (free)

How to use
getCustomEditor
method
in
org.springframework.validation.AbstractPropertyBindingResult

Best Java code snippets using org.springframework.validation.AbstractPropertyBindingResult.getCustomEditor (Showing top 3 results out of 315)

origin: spring-projects/spring-framework

/**
 * Formats the field value based on registered PropertyEditors.
 * @see #getCustomEditor
 */
@Override
protected Object formatFieldValue(String field, @Nullable Object value) {
  String fixedField = fixedField(field);
  // Try custom editor...
  PropertyEditor customEditor = getCustomEditor(fixedField);
  if (customEditor != null) {
    customEditor.setValue(value);
    String textValue = customEditor.getAsText();
    // If the PropertyEditor returned null, there is no appropriate
    // text representation for this value: only use it if non-null.
    if (textValue != null) {
      return textValue;
    }
  }
  if (this.conversionService != null) {
    // Try custom converter...
    TypeDescriptor fieldDesc = getPropertyAccessor().getPropertyTypeDescriptor(fixedField);
    TypeDescriptor strDesc = TypeDescriptor.valueOf(String.class);
    if (fieldDesc != null && this.conversionService.canConvert(fieldDesc, strDesc)) {
      return this.conversionService.convert(value, fieldDesc, strDesc);
    }
  }
  return value;
}
origin: org.springframework/spring-context

/**
 * Formats the field value based on registered PropertyEditors.
 * @see #getCustomEditor
 */
@Override
protected Object formatFieldValue(String field, @Nullable Object value) {
  String fixedField = fixedField(field);
  // Try custom editor...
  PropertyEditor customEditor = getCustomEditor(fixedField);
  if (customEditor != null) {
    customEditor.setValue(value);
    String textValue = customEditor.getAsText();
    // If the PropertyEditor returned null, there is no appropriate
    // text representation for this value: only use it if non-null.
    if (textValue != null) {
      return textValue;
    }
  }
  if (this.conversionService != null) {
    // Try custom converter...
    TypeDescriptor fieldDesc = getPropertyAccessor().getPropertyTypeDescriptor(fixedField);
    TypeDescriptor strDesc = TypeDescriptor.valueOf(String.class);
    if (fieldDesc != null && this.conversionService.canConvert(fieldDesc, strDesc)) {
      return this.conversionService.convert(value, fieldDesc, strDesc);
    }
  }
  return value;
}
origin: apache/servicemix-bundles

/**
 * Formats the field value based on registered PropertyEditors.
 * @see #getCustomEditor
 */
@Override
protected Object formatFieldValue(String field, @Nullable Object value) {
  String fixedField = fixedField(field);
  // Try custom editor...
  PropertyEditor customEditor = getCustomEditor(fixedField);
  if (customEditor != null) {
    customEditor.setValue(value);
    String textValue = customEditor.getAsText();
    // If the PropertyEditor returned null, there is no appropriate
    // text representation for this value: only use it if non-null.
    if (textValue != null) {
      return textValue;
    }
  }
  if (this.conversionService != null) {
    // Try custom converter...
    TypeDescriptor fieldDesc = getPropertyAccessor().getPropertyTypeDescriptor(fixedField);
    TypeDescriptor strDesc = TypeDescriptor.valueOf(String.class);
    if (fieldDesc != null && this.conversionService.canConvert(fieldDesc, strDesc)) {
      return this.conversionService.convert(value, fieldDesc, strDesc);
    }
  }
  return value;
}
org.springframework.validationAbstractPropertyBindingResultgetCustomEditor

Javadoc

Retrieve the custom PropertyEditor for the given field, if any.

Popular methods of AbstractPropertyBindingResult

  • getPropertyAccessor
    Provide the PropertyAccessor to work with, according to the concrete strategy of access.Note that a
  • fixedField
  • getFieldType
    Determines the field type from the property type.
  • getTarget
  • initConversion
  • setMessageCodesResolver
  • getPropertyEditorRegistry
    Returns the underlying PropertyAccessor.

Popular in Java

  • Running tasks concurrently on multiple threads
  • notifyDataSetChanged (ArrayAdapter)
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now