Annotation Type Model


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

    • adaptables

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

      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:
      REQUIRED
    • condition

      String condition
      Returns:
      Condition that is displayed in the felix console adapter plugin
      Default:
      ""
    • validation

      ValidationStrategy validation
      Returns:
      ValidationStrategy.DISABLED in case the model should not be validated through Sling Validation (default), ValidationStrategy.REQUIRED in case the model should be validated and if no appropriate Sling Validation Model exists it is considered invalid or ValidationStrategy.OPTIONAL in case the model should be validated only in case an appropriate Sling Validation Model is found.
      See Also:
      Default:
      DISABLED
    • resourceType

      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