Annotation Type Model


  • @Target(TYPE)
    @Retention(RUNTIME)
    @Documented
    public @interface Model
    Mark a class as adaptable via Sling Models.
    • Element Detail

      • adaptables

        java.lang.Class<?>[] adaptables
        Returns:
        List of classes from which can be adapted.
      • adapters

        java.lang.Class<?>[] adapters
        Returns:
        List of classes to which can be adapted. If missing, the class that is annotated is used. If classes are given, they have to be either the annotated class itself, or interfaces or super classes of the class. The annotated class itself is always implicitly added to the adapters and does not need to be listed explicitly here.
        Default:
        {}
      • defaultInjectionStrategy

        DefaultInjectionStrategy defaultInjectionStrategy
        Returns:
        Default injection strategy (optional or required)
        Default:
        org.apache.sling.models.annotations.DefaultInjectionStrategy.REQUIRED
      • condition

        java.lang.String condition
        Returns:
        Condition that is displayed in the felix console adapter plugin
        Default:
        ""
      • resourceType

        java.lang.String[] resourceType
        Returns:
        the associated resource type for this model class
        Default:
        {}
      • cache

        boolean cache
        Returns:
        whether or not the model should be cached for the lifecycle of the adaptable
        Default:
        false