|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.spi.config.support.ClassPathLoader<T>
T
- the concrete type of the returned configuration properties.
@NotThreadSafe public final class ClassPathLoader<T extends ConfigurationPropertiesManagement>
Loads property descriptors and properties files found on the class path.
Constructor Summary | |
---|---|
ClassPathLoader(FactoryCache<T> factoryCache, boolean lenient, boolean skipPropertyLoading, de.smartics.properties.api.core.security.PropertyValueSecurity decrypter) Default constructor. |
Method Summary | |
---|---|
void |
addDefaultRootUrls() Adds all class path root URLs provided by the context class loader of the current thread. |
void |
addRootProperties(List<PropertyProvider> rootPropertyProviders) Adds the given property providers as additional property definitions. |
void |
addRootUrl(Class<?> exemplar) Adds the root URL of the given exemplar to the set of class path root URLs. |
void |
addRootUrl(ClassLoader classLoader) Adds the relevant root URL of the given classLoader to the set of class path root URLs. |
void |
addRootUrl(URL rootUrl) Adds the given URL to the set of class path root URLs. |
void |
addRootUrls(List<URL> rootLocations) Adds the given root URLs to the collection of class path roots managed by this class loader. |
ConfigurationRepositoryManagement |
load() Loads the configuration properties instance from information found on the class path. |
String |
toString() Returns the string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClassPathLoader(FactoryCache<T> factoryCache, boolean lenient, boolean skipPropertyLoading, de.smartics.properties.api.core.security.PropertyValueSecurity decrypter) throws de.smartics.util.lang.NullArgumentException
factoryCache
- the cache to create and cache new configuration properties instances.
lenient
- the flag indicates that configuration problems are not signaled by exceptions.
skipPropertyLoading
- the flag indicates that loading properties from the class path is to be skipped.
decrypter
- the helper to decrypt secured property values.
de.smartics.util.lang.NullArgumentException
- if
factoryCache
or
decrypter
is
null
.
Method Detail |
---|
public void addRootUrl(URL rootUrl) throws de.smartics.util.lang.NullArgumentException
rootUrl
- the URL to add as a class path root URL.
de.smartics.util.lang.NullArgumentException
- if
rootUrl
is
null
.
public void addRootUrl(Class<?> exemplar) throws de.smartics.util.lang.NullArgumentException
exemplar
to the set of class path root URLs.
exemplar
- a sample class to derive the root URL from.
de.smartics.util.lang.NullArgumentException
- if
exemplar
is
null
.
public void addRootUrl(ClassLoader classLoader) throws de.smartics.util.lang.NullArgumentException
classLoader
to the set of class path root URLs.
Only archives that contain the "META-INF/smartics-properties"
are relevant and therefore added.
classLoader
- the class loader whose class roots are added.
de.smartics.util.lang.NullArgumentException
- if
exemplar
is
null
.
public ConfigurationRepositoryManagement load() throws CompoundConfigurationException
CompoundConfigurationException
- if loading encountered problems.
public void addDefaultRootUrls()
public void addRootUrls(List<URL> rootLocations)
rootLocations
- the additional root locations to search for property declarations and definitions.
public void addRootProperties(List<PropertyProvider> rootPropertyProviders)
Property values provided by these providers take precedence over any property values found on the class path.
rootPropertyProviders
- the additional property definitions to add.
public String toString()
toString
in class
Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |