Class PropertyEditorFinder

  • Direct Known Subclasses:
    DefaultPropertyEditorFinder

    public abstract class PropertyEditorFinder
    extends java.lang.Object
    Simple abstract class to provide base for PropertyEditorFinder service.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.beans.PropertyEditor find​(java.lang.Class<?> type)
      Returns PropertyEditor which capable of converting String into instances of type parameter.
      abstract java.lang.String[] getEditorSearchPackages()  
      static PropertyEditorFinder getInstance()  
      static PropertyEditorFinder getInstance​(java.lang.ClassLoader classLoader)
      Returns instance of property finder.
      private static void init​(java.lang.ClassLoader classLoader)  
      abstract void register​(java.lang.Class<?> type, java.lang.Class<? extends java.beans.PropertyEditor> editor)
      If supported, this method register editor class for specific type.
      abstract void setEditorSearchPackages​(java.lang.String[] packages)
      If supported this sets search packages.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertyEditorFinder

        public PropertyEditorFinder()
    • Method Detail

      • find

        public abstract java.beans.PropertyEditor find​(java.lang.Class<?> type)
        Returns PropertyEditor which capable of converting String into instances of type parameter.
        Parameters:
        type - - class object representing type of property beeing converted from String to object instance.
        Returns:
      • register

        public abstract void register​(java.lang.Class<?> type,
                                      java.lang.Class<? extends java.beans.PropertyEditor> editor)
        If supported, this method register editor class for specific type. When queried, finder will return registered editor class. Check {find(Class) method.
        Parameters:
        type - - class object representing type of property, ie. int[].class, InetAddress.class
        editor - - editor class which is capable of converting type, to and from String.
      • setEditorSearchPackages

        public abstract void setEditorSearchPackages​(java.lang.String[] packages)
        If supported this sets search packages. Finder will search those packages for viable editor classe.
        Parameters:
        packages - - set of packages, ie. {"com.sun.beans","custom.editors"}
      • getEditorSearchPackages

        public abstract java.lang.String[] getEditorSearchPackages()
        Returns:
        - current search packages.
      • init

        private static void init​(java.lang.ClassLoader classLoader)
      • getInstance

        public static PropertyEditorFinder getInstance​(java.lang.ClassLoader classLoader)
        Returns instance of property finder. Instance is loaded as ServiceLoader service. If no service is found, this method, this method will return null.
        Returns:
        Instance of PropertyEditorFinder.