Class AbstractPropertySource<T>

    • Field Detail

      • PROPERTIES_FILE

        public static final String PROPERTIES_FILE
        Default file to read properties from, value is "classpath:/org/ldaptive/ldap.properties".
        See Also:
        Constant Field Values
      • logger

        protected final Logger logger
        Logger for this class.
      • object

        protected final T object
        Object to initialize with properties.
      • properties

        protected final Properties properties
        Properties to set.
      • extraProps

        protected final Map<String,​Object> extraProps
        Properties that are not in the ldaptive domain.
    • Constructor Detail

      • AbstractPropertySource

        public AbstractPropertySource​(T t,
                                      PropertySource.PropertyDomain pd,
                                      Properties p)
        Creates a new abstract property source.
        Parameters:
        t - to set properties on
        pd - domain that properties reside in
        p - properties to set
    • Method Detail

      • loadProperties

        protected static Properties loadProperties​(String... paths)
        Creates properties from the supplied file paths. See loadProperties(Reader...).
        Parameters:
        paths - to read properties from
        Returns:
        initialized properties object.
      • loadProperties

        protected static Properties loadProperties​(Reader... readers)
        Creates properties from the supplied reader. See Properties.load(Reader). Readers supplied to this method will be closed.
        Parameters:
        readers - to read properties from
        Returns:
        initialized properties object.
      • initializeObject

        protected void initializeObject​(PropertyInvoker invoker)
        Iterates over the properties and uses the invoker to set those properties on the object. Any properties that do not belong to the object are set in the extraProps map.
        Parameters:
        invoker - to set properties on the object