THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- @Model - declares a model class or interface
- @Inject - marks a field or method as injectable
- @Named - declare a name for the injection (otherwise, defaults based on field or method name).
- @Optional - marks a field or method injection as optional
- @Source - explictly tie an injected field or method to a particular injector (by name). Can also be on other annotations.
- @Filter - an OSGi service filter
- @PostConstruct - methods to call upon model option creation (only for model classes)
- @Via - use a JavaBean property of the adaptable as the source of the injection
- @Default - set default values for a field or method
Available Injectors
Title | Name (for @Source) | Description | Applicable To (including using @Via) | Notes |
---|---|---|---|---|
Value Map |
...
valuemap | Gets a property from a Value Map | Any object which is or can be adapted to a ValueMap | ||
OSGI Services | osgi-services | Lookup services based on class name |
...
Any object | Effectively ignores name. | |
Script Bindings |
...
script-bindings |
...
Lookup objects in the script bindings object | A ServletRequest object which has the Sling Bindings attribute defined | ||
Child Resources |
...
child-resources |
...
Gets a child resource by name | Resource objects | ||
Request Attributes |
...
request- |
...
attributes | Get a request attribute | ServletRequest objects |