Package org.ldaptive.props
Class AbstractPropertySource<T>
- java.lang.Object
-
- org.ldaptive.props.AbstractPropertySource<T>
-
- Type Parameters:
T
- type of object to invoke properties on
- All Implemented Interfaces:
PropertySource<T>
- Direct Known Subclasses:
AbstractConnectionFactoryManagerPropertySource
,AuthenticationRequestPropertySource
,AuthenticatorPropertySource
,BeanGeneratorPropertySource
,BindConnectionInitializerPropertySource
,BlockingConnectionPoolPropertySource
,ConnectionConfigPropertySource
,DefaultConnectionFactoryPropertySource
,PooledConnectionFactoryPropertySource
,SearchConnectionValidatorPropertySource
,SearchRequestPropertySource
,SimplePropertySource
,SslConfigPropertySource
public abstract class AbstractPropertySource<T> extends java.lang.Object implements PropertySource<T>
Provides methods common to property source implementations.- Author:
- Middleware Services
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ldaptive.props.PropertySource
PropertySource.PropertyDomain
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.Object>
extraProps
Properties that are not in the ldaptive domain.protected org.slf4j.Logger
logger
Logger for this class.protected T
object
Object to initialize with properties.protected java.util.Properties
properties
Properties to set.static java.lang.String
PROPERTIES_FILE
Default file to read properties from, value is "classpath:/org/ldaptive/ldap.properties".protected PropertySource.PropertyDomain
propertiesDomain
Domain that properties are in.
-
Constructor Summary
Constructors Constructor Description AbstractPropertySource(T t, PropertySource.PropertyDomain pd, java.util.Properties p)
Creates a new abstract property source.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
initializeObject(PropertyInvoker invoker)
Iterates over the properties and uses the invoker to set those properties on the object.protected static java.util.Properties
loadProperties(java.io.Reader... readers)
Creates properties from the supplied reader.protected static java.util.Properties
loadProperties(java.lang.String... paths)
Creates properties from the supplied file paths.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ldaptive.props.PropertySource
initialize
-
-
-
-
Field Detail
-
PROPERTIES_FILE
public static final java.lang.String PROPERTIES_FILE
Default file to read properties from, value is "classpath:/org/ldaptive/ldap.properties".- See Also:
- Constant Field Values
-
logger
protected final org.slf4j.Logger logger
Logger for this class.
-
object
protected final T object
Object to initialize with properties.
-
propertiesDomain
protected final PropertySource.PropertyDomain propertiesDomain
Domain that properties are in.
-
properties
protected final java.util.Properties properties
Properties to set.
-
extraProps
protected final java.util.Map<java.lang.String,java.lang.Object> extraProps
Properties that are not in the ldaptive domain.
-
-
Constructor Detail
-
AbstractPropertySource
public AbstractPropertySource(T t, PropertySource.PropertyDomain pd, java.util.Properties p)
Creates a new abstract property source.- Parameters:
t
- to set properties onpd
- domain that properties reside inp
- properties to set
-
-
Method Detail
-
loadProperties
protected static java.util.Properties loadProperties(java.lang.String... paths)
Creates properties from the supplied file paths. SeeloadProperties(Reader...)
.- Parameters:
paths
- to read properties from- Returns:
- initialized properties object.
-
loadProperties
protected static java.util.Properties loadProperties(java.io.Reader... readers)
Creates properties from the supplied reader. SeeProperties.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
-
-