Package io.microsphere.metadata
Interface ConfigurationPropertyLoader
-
- All Superinterfaces:
java.lang.Comparable<Prioritized>,Prioritized
- All Known Implementing Classes:
AdditionalMetadataResourceConfigurationPropertyLoader,ClassPathResourceConfigurationPropertyLoader,MetadataResourceConfigurationPropertyLoader
public interface ConfigurationPropertyLoader extends Prioritized
The Java SPI of the loader ofConfigurationPropertythat will beloaded byMicrosphere Annotation Processor module.- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
ConfigurationProperty,ConfigurationProperty
-
-
Field Summary
-
Fields inherited from interface io.microsphere.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<ConfigurationProperty>load()Loads a list ofConfigurationPropertyinstances.static java.util.List<ConfigurationProperty>loadAll()Loads allConfigurationPropertyinstances by loading and executing all availableConfigurationPropertyLoaderservices via Java SPI mechanism.-
Methods inherited from interface io.microsphere.lang.Prioritized
compareTo, getPriority
-
-
-
-
Method Detail
-
load
@Nullable java.util.List<ConfigurationProperty> load() throws java.lang.Throwable
Loads a list ofConfigurationPropertyinstances.Example Usage
ConfigurationPropertyLoader loader = ...; // Obtain an instance of a concrete implementation List<ConfigurationProperty> properties = loader.load(); for (ConfigurationProperty property : properties) { System.out.println("Property Name: " + property.getName()); System.out.println("Property Type: " + property.getType()); System.out.println("Property Value: " + property.getValue()); }- Returns:
- a list of loaded
ConfigurationPropertyinstances, or an empty list ornullif no properties are loaded - Throws:
java.lang.Throwable- if any error occurs during generation- See Also:
ConfigurationProperty
-
loadAll
@Nonnull @Immutable static java.util.List<ConfigurationProperty> loadAll()
Loads allConfigurationPropertyinstances by loading and executing all availableConfigurationPropertyLoaderservices via Java SPI mechanism.Example Usage
List<ConfigurationProperty> properties = ConfigurationPropertyLoader.generateAll(); for (ConfigurationProperty property : properties) { System.out.println("Property Name: " + property.getName()); System.out.println("Property Type: " + property.getType()); System.out.println("Property Value: " + property.getValue()); }- Returns:
- a list of loaded
ConfigurationPropertyinstances, or an empty list if no loaders are found - Throws:
java.lang.Throwable- if any error occurs during generation- See Also:
load(),ServiceLoaderUtils.loadServicesList(Class)
-
-