Class PropertyEditorRegistry

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class PropertyEditorRegistry
    extends java.lang.Object
    implements java.io.Closeable
    • Field Detail

      • registry

        private final java.util.concurrent.ConcurrentMap<java.lang.reflect.Type,​Converter> registry
    • Constructor Detail

      • PropertyEditorRegistry

        public PropertyEditorRegistry()
    • Method Detail

      • getRegistry

        public java.util.Map<java.lang.reflect.Type,​Converter> getRegistry()
        Returns:
        a read-only view of the converters.
      • register

        public Converter register​(Converter converter)
        Register a converter in the registry.
        Parameters:
        converter - the converter to register.
        Returns:
        the previously existing converter for the corresponding type or null.
      • unregister

        public Converter unregister​(Converter converter)
        Unregister a converter.
        Parameters:
        converter - the converter to remove from the registry.
        Returns:
        the converter if found, or null.
      • findConverter

        public Converter findConverter​(java.lang.reflect.Type type)
      • unwrapClass

        protected java.lang.Class<?> unwrapClass​(java.lang.Object value)
      • findStructuralConverter

        protected Converter findStructuralConverter​(java.lang.reflect.Type type)
      • createConverterFromEditor

        protected Converter createConverterFromEditor​(java.lang.reflect.Type type)
      • findInternalConverter

        protected Converter findInternalConverter​(java.lang.reflect.Type type)
      • findEditor

        protected java.beans.PropertyEditor findEditor​(java.lang.reflect.Type type)
        Locate a property editor for qiven class of object.
        Parameters:
        type - The target object class of the property.
        Returns:
        The resolved editor, if any. Returns null if a suitable editor could not be located.
      • close

        public void close()
        Release closeable converters.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable