All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.icfolson.aem.library.models.annotations.LinkInject Maven / Gradle / Ivy

The newest version!
package com.icfolson.aem.library.models.annotations;

import org.apache.sling.models.annotations.Source;
import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy;
import org.apache.sling.models.spi.injectorspecific.InjectAnnotation;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Target({ METHOD, FIELD, PARAMETER })
@Retention(RUNTIME)
@InjectAnnotation
@Source(LinkInject.NAME)
public @interface LinkInject {

    String NAME = "links";

    /**
     * if set to REQUIRED injection is mandatory, if set to OPTIONAL injection is optional, in case of DEFAULT the
     * standard annotations ( {@link org.apache.sling.models.annotations.Optional}, {@link
     * org.apache.sling.models.annotations.Required}) are used. If even those are not available the default injection
     * strategy defined on the {@link org.apache.sling.models.annotations.Model} applies. Default value = DEFAULT.
     *
     * @return Injection strategy
     */
    InjectionStrategy injectionStrategy() default InjectionStrategy.DEFAULT;

    /**
     * The property to use for setting the title on the link
     *
     * @return name of title property
     */
    String titleProperty() default "";

    /**
     * Whether to get the link via inheriting
     *
     * @return true if inherited
     */
    boolean inherit() default false;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy