@Target(value={METHOD,FIELD,PARAMETER}) @Retention(value=RUNTIME) @InjectAnnotation public @interface AemObject
Supports the following objects:
Class | Description | Name hint | Request | ResourceResolver | Resource |
---|---|---|---|---|---|
PageManager |
AEM Page manager | X | X | X | |
Page |
AEM page addressed by the current request. Default to be injected for Page types. |
currentPage | X | X* | X |
Page |
AEM page containing the current resource. | resourcePage | X | X* | X |
WCMMode |
Current AEM WCM mode | X | X* | X* | |
AuthoringUIMode |
Current AEM Authoring UI mode. Defaults to Touch UI if mode is not set. | X | X* | X* | |
ComponentContext |
AEM component context of current request | X | X* | X* | |
Designer |
AEM designer | X | X | X | |
Design |
AEM design of the current page | X | X* | X | |
Style |
AEM design style of the current component | X | X* | X* | |
XSSAPI |
AEM XSS API object for the current request | X | X* | X* | |
I18n |
I18n object for the current resource/page context. Default to be inejctes for I18n types. |
resourceI18n | X | X* | X* |
I18n |
I18n object for the current user | userI18n | X | X* | X* |
TagManager |
AEM Tag manager | X | X | X | |
WorkflowSession |
Granite Workflow Session | X | X | X |
In case of X* the class cannot be derived from the adaptable, but is derived from the request of the current thread
detected via RequestContext
. If the current thread is not associated with a
request nothing is injected.
Modifier and Type | Optional Element and Description |
---|---|
org.apache.sling.models.annotations.injectorspecific.InjectionStrategy |
injectionStrategy
if set to REQUIRED injection is mandatory, if set to OPTIONAL injection is optional, in case of DEFAULT
the standard annotations (
Optional ,
Required ) are used. |
String |
name
Specifies the name of the request attribute.
|
boolean |
optional
Deprecated.
Use
injectionStrategy() instead |
public abstract String name
For most injections of AemObject this is not required, it is only use as name-hint for injectint a Page object.
public abstract org.apache.sling.models.annotations.injectorspecific.InjectionStrategy injectionStrategy
Optional
,
Required
) are used.
If even those are not available the default injection strategy defined on the
Model
applies.
Default value = DEFAULT.@Deprecated public abstract boolean optional
injectionStrategy()
insteadCopyright © 2014–2021 wcm.io. All rights reserved.