|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.tutorial.config.key.NoConfigurationKeyTutorial
@Document(title="No Configuration Key Required", sortKey="basics1020") @DocCategory(value="basics") public class NoConfigurationKeyTutorial
This tutorial shows how to use plain properties files and access it with a generic configuration key. This is a solution to choose if you just want to use the annotation stuff but do not bother with different configuration keys.
Constructor Summary | |
---|---|
NoConfigurationKeyTutorial() |
Method Summary | |
---|---|
void |
accessConfigurationByHardcodedKey() In this example we assume that there are multiple modules in a single application, but there is no need to handle different configurations. |
void |
setUp() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NoConfigurationKeyTutorial()
Method Detail |
---|
public void setUp()
@DocChapter public void accessConfigurationByHardcodedKey()
In this example we assume that there are multiple modules in a single application, but there is no need to handle different configurations. Accessing properties provided to the application via annotations is simply everything that is required. We show that you do not have to bother with configuration keys since everything that is required to appease the system is done automatically behind the scenes.
The following modules are declared as dependencies to the application:
de.smartics.sandbox test-module-mail de.smartics.sandbox test-module-announce
The definition for these properties is provided by a dependency like this:
de.smartics.sandbox test-application-config-nokey
At we create the default configuration. This configuration holds all property definitions that are not associated to a particular key.
At and we only show that accessing the properties really show the values from the definition files.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |