Class ManifestFilePropertySource
java.lang.Object
org.apache.juneau.commons.settings.ManifestFilePropertySource
- All Implemented Interfaces:
PropertySource
Property source backed by
ManifestFile.-
Constructor Summary
ConstructorsConstructorDescriptionManifestFilePropertySource(Supplier<ManifestFile> manifestSupplier) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic ManifestFilePropertySourceCreates a source with default classloader scanning behavior.Returns a property in this property source.
-
Constructor Details
-
ManifestFilePropertySource
Constructor.The supplied
manifestSupplieris wrapped in aMemoizerso the manifest is loaded at most once per source instance. Without this, everyget(String)call would re-scan the classpath, which is very expensive and shows up as a 2x test-suite regression when this source is registered inSettings.- Parameters:
manifestSupplier- The supplier for manifest file. Must not benull .
-
-
Method Details
-
createDefault
Creates a source with default classloader scanning behavior.- Returns:
- A new source.
-
get
Description copied from interface:PropertySourceReturns a property in this property source.- Specified by:
getin interfacePropertySource- Parameters:
name- The property name.- Returns:
- The property lookup result:
PropertyLookupResult.missing()if this source does not define the key.PropertyLookupResult.present(Optional)withOptional.empty()if the key exists with a null value.PropertyLookupResult.present(Optional)with a value if the key exists with a non-null value.
-