Skip to content

Latest commit

 

History

History
89 lines (60 loc) · 3.75 KB

README_original.md

File metadata and controls

89 lines (60 loc) · 3.75 KB

settings4jlogo

Status Deprecated Build Status Coverage Status Coverity Dependency Status Codacy Badge Maven site Maven Central Javadocs License: Apache 2.0 Gitter

Settings for Java

Settings4j provides you with a lightweight Java library that allows programmers not to worry about the location where the configuration settings are stored.

Designed to ease the development process, settings4j can decide where the value will be placed, so the developer does not have to select the type of configuration.

Dependency Information

Simply add to your pom.xml:

<dependency>
  <groupId>org.settings4j</groupId>
  <artifactId>settings4j</artifactId>
  <version>2.0.1</version>
</dependency>

See https://maven-badges.herokuapp.com/maven-central/org.settings4j/settings4j

You don't know how your Project should be configured (System Properties, JNDI, Preferences, others...)?

Use settings4j:

  String myValue = Settings4j.getString("SOME_KEY");

The Default Configuration works in the following Order to get Configuration-Values:

  • Lookup in System.getProperty(...)
  • Lookup in JNDI Context
  • Lookup in Preferences.userRoot() and then Preferences.systemRoot()
  • Lookup in Classpath

With Settings4j, your Operation can decide how the application should be configured.

See http://settings4j.org

You are not happy with the default setting4j config?

Simply put your own settings4j.xml into the root-classpath or configure it manual in Java.

See http://settings4j.org/archiv/latest/config.html

You use Spring?

You probable uses "@Value" annotation like that:

  @Value("${SOME_KEY}")
  String myValue;

simply configure Settings4jPlaceholderConfigurer and your "@Value" Annotations will be processes through Settings4j:

<beans>
  <!-- The PlaceholderConfigurer: -->
  <bean class="org.settings4j.helper.spring.Settings4jPlaceholderConfigurer" />
</beans>

(Works also with Spring Java Based Configuration)

See http://settings4j.org/archiv/latest/configSpringPlaceholder.html

License

This project is licensed under Apache License, Version 2.0.

See https://github.com/brabenetz/settings4j/blob/master/LICENSE.txt