All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yarnandtail.andhow.AndHowInit Maven / Gradle / Ivy

Go to download

Simple typed and validated configuration loading for web apps, command line or any environment application.

There is a newer version: 1.5.0
Show newest version
package org.yarnandtail.andhow;

/**
 * Marks a class as an auto-discovered configuration provider for AndHow.
 * 
 * A single instance of this interface on the classpath, if it exists, will be
 * auto-discovered and used to initiate AndHow at the time of the first attempt
 * to access a property.
 * 
 * Alternatively, if AndHow is explicitly initiated, the configuration from a
 * AndHowInit instance can be used for that configuration.  This provides the
 * safety of an explicit configuration if needed, the convenience of an auto-
 * discovered configuration if wanted, and shared configuration code between
 * those two alternatives.
 * 
 * Note that it is a fatal RuntimeException for there to be more than a single
 * AndHowInit implementation on the classpath because startup would become
 * ambiguous*.  In general, never place a non-abstract AndHowInit implementation
 * in a reusable library since this would prevent any user of that library
 * from creating their own AndHowInit implementation.
 * 
 * *In addition to a single AndHowInit implementation, a single
 * AndHowTestInit is also allowed.  If an AndHowTestInit
 * implementation is present, it will be used in preference to the AndHowInit.
 * This allows a test configuration to take precedence over the
 * production configuration simply by placing a AndHowTestInit
 * implementation on the test classpath.
 * 
 * @author ericeverman
 */
public interface AndHowInit {
	AndHowConfiguration getConfiguration();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy