THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
public class MyService implements MyServiceInterface { private boolean productionMode; public MyService(@Value("${tapestry.production-mode}") boolean productionMode, ...) { if this.productionMode = productionMode; (productionMode) { . . . |
Here Tapestry has coerced the "tapestry.production-mode" symbol to a boolean to be injected.
...
Code Block | ||||
---|---|---|---|---|
| ||||
public class MyService implements MyServiceInterface { private boolean productionMode; public MyService(@Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode, ...) { if this.productionMode = productionMode; (productionMode) { . . . |
This is very useful when a constant value is defined for the symbol; it means that the compiler can catch a typo, rather than detecting it a runtime.
...
Symbols are resolved by the SymbolSource service. The SymbolSource service checks against an ordered list of SymbolProvider objects.
...