/*
 * Copyright 2015 Michael Rozumyanskiy
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.michaelrocks.lightsaber;

public class Lightsaber {
    public static void injectMembers(Object target) {
        throw new IllegalStateException(
                "This method must not be called. It must be substituted with a valid injector instead.");
    }
}

@@ -640,88 +640,386 @@
 r;%0A%0A
-public class Lightsaber %7B%0A    public static void injectMembers(Object target) %7B%0A
+import com.michaelrocks.lightsaber.internal.InternalModule;%0Aimport com.michaelrocks.lightsaber.internal.LightsaberInjector;%0A%0Apublic class Lightsaber %7B%0A    public static Injector createInjector(final Module... modules) %7B%0A        final LightsaberInjector injector = new LightsaberInjector();%0A        for (final Module module : modules) %7B%0A            if (module == null) %7B%0A        
     
@@ -1036,20 +1036,19 @@
 new 
-IllegalSta
+NullPoin
 te
+r
 Exce
@@ -1053,16 +1053,64 @@
 ception(
+%22Trying to create injector with a null module%22);
 %0A       
@@ -1110,24 +1110,31 @@
         
+    %7D%0A%0A
         
 %22This me
@@ -1129,96 +1129,267 @@
     
-%22This method must not be called. It must be substituted with a valid i
+    if (!(module instanceof InternalModule)) %7B%0A                throw new ConfigurationException(%22Module %22 + module + %22 hasn't been processed%22);%0A            %7D%0A%0A            ((InternalModule) module).configureI
 njector
- instead.%22)
+(injector);%0A        %7D%0A        return injector
 ;%0A  

Use Lightsaber class for creating injectors