Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-3704

Provide better examples/documentation on how to test an injector

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • Sling Models API 1.0.2, Sling Models Implementation 1.0.6
    • None
    • Extensions

    Description

      In the future, I plan to create a custom injector for Sling Models. It would be great if documentation will have some section which describes how do it in a most simple way.

      Also API / Impl could be improved for that perspective of usage.
      I would like to use in my package following snippet which I found in unit tests:

      factory = new ModelAdapterFactory();
      factory.activate(componentCtx);
      factory.bindInjector(new MyCustomInjector(), new ServicePropertiesMap(1, 1));

      But methods in factory have protected scope and I cannot use them directly in my package without using a reflection.

      I realize that maybe custom injectors are not planned in design but I hope that suggested improvement could make SM more extensible.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kpanek Krystian Panek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: