src.site.apt.joker.apt Maven / Gradle / Ivy
------
Joker
------
Max Antoni
------
04.03.2007
------
~~ Copyright (c) 2006-2007 Maximilian Antoni. All rights reserved.
~~ This software is licensed as described in the file LICENSE.txt, which you
~~ should have received as part of this distribution. The terms are also
~~ available at http://www.maxantoni.de/projects/eva-properties/license.txt.
~~ NOTE: For help with the syntax of this file, see:
~~ http://maven.apache.org/guides/mini/guide-apt-format.html
Joker
In the following example, a default value is provided for eveything under map:
+----------------------------------------------+
map: {
*: "default"
foo: "Foo"
bar: "Bar"
}
+----------------------------------------------+
Resolving "map.foo" returns "Foo", resolving "map.bla" returns "default".
Another possible use for a joker is:
+----------------------------------------------+
names: ${maps.*.name}
maps: {
map1: {
name: "Map 1"
}
map2: {
name: "Map 2"
}
map3: {
no-name-here: true
}
}
+----------------------------------------------+
Resolving "names" returns a map with this content:
+----------------------------------------------+
map1: "Map 1"
map2: "Map 2"
+----------------------------------------------+
It is also possible to have more than one joker in a reference:
+----------------------------------------------+
nestedNames: ${nested.*.*.name}
nestedValues: ${nested.*.*.value}
nested: {
colors: {
red: {
name: Red
value: "#ff0000"
}
green: {
name: Green
value: "#00ff00"
}
}
hello: {
world: {
name: HelloWorld
value: "Hello world!"
}
}
}
+----------------------------------------------+
Resolving "nestedNames" returns a map with this content:
+----------------------------------------------+
colors: {
red: "Red"
green: "Green"
}
hello: {
world: "HelloWorld"
}
+----------------------------------------------+
Resolving "nestedValues" returns a map with this content:
+----------------------------------------------+
colors: {
red: "#ff0000"
green: "#00ff00"
}
hello: {
world: "Hello world!"
}
+----------------------------------------------+
© 2015 - 2025 Weber Informatics LLC | Privacy Policy