Package org.scijava

Class SciJava

    • Constructor Detail

      • SciJava

        public SciJava()
        Creates a new SciJava application context with all available services.
      • SciJava

        public SciJava​(boolean empty)
        Creates a new Scijava application context.
        Parameters:
        empty - If true, the context will be empty; otherwise, it will be initialized with all available services.
      • SciJava

        public SciJava​(Class... serviceClasses)
        Creates a new SciJava application context with the specified services (and any required service dependencies).

        Developer's note: This constructor's argument is raw (i.e., Class... instead of Class<? extends Service>...) because otherwise, downstream invocations (e.g., new SciJava(LogService.class)) yield the potentially confusing warning:

        Type safety: A generic array of Class<? extends Service> is created for a varargs parameter

        To avoid this, we have opted to use raw types and suppress the relevant warning here instead.

        Parameters:
        serviceClasses - A list of types that implement the Service interface (e.g., LogService.class).
        Throws:
        ClassCastException - If any of the given arguments do not implement the Service interface.
      • SciJava

        public SciJava​(Collection<Class<? extends Service>> serviceClasses)
        Creates a new SciJava application context with the specified services (and any required service dependencies).
        Parameters:
        serviceClasses - A collection of types that implement the Service interface (e.g., LogService.class).
      • SciJava

        public SciJava​(Context context)
        Creates a new SciJava application context which wraps the given existing SciJava context.
        See Also:
        Context