// Path: library/src/main/java/com/danikula/aibolit/InjectingException.java
// public class InjectingException extends RuntimeException {
// 
//     private static final long serialVersionUID = -1L;
// 
//     public InjectingException(String message) {
//         super(message);
//     }
// 
//     public InjectingException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public InjectingException(Throwable cause) {
//         super(cause);
//     }
// }
// 
// Path: library/src/main/java/com/danikula/aibolit/ServicesResolver.java
// public interface ServicesResolver {
// 
//     /**
//      * Resolves application service by class
//      * 
//      * @param serviceClass Class service's class
//      * @return Object application service
//      */
//     Object resolve(Class<?> serviceClass);
// 
// }
// 
// Path: library/src/main/java/com/danikula/aibolit/Validate.java
// public class Validate {
// 
//     /**
//      * Checks variable on <code>null</code>
//      * 
//      * @param object Object variable to be checked
//      * @param message String message of exception to be throwed if parameter is <code>null</code>
//      * @throws IllegalArgumentException if <code>object</code> is <code>null</code>
//      */
//     public static void notNull(Object object, String message) {
//         if (object == null) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// 
//     /**
//      * Checks contition on <code>true</code>
//      * 
//      * @param condition boolean condition to check
//      * @param message String message of exception to be throwed if condition is not <code>true</code>
//      * @throws IllegalArgumentException if <code>condition</code> is not <code>true</code>
//      */
//     public static void checkTrue(boolean condition, String message) {
//         if (!condition) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// 
// }


import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.danikula.aibolit.InjectingException;
import com.danikula.aibolit.ServicesResolver;
import com.danikula.aibolit.Validate;
import com.danikula.aibolit.annotation.InjectArrayAdapter;
import com.danikula.aibolit.annotation.InjectOnCheckedChangeListener;
import com.danikula.aibolit.annotation.InjectOnClickListener;
import com.danikula.aibolit.annotation.InjectOnCreateContextMenuListener;
import com.danikula.aibolit.annotation.InjectOnEditorActionListener;
import com.danikula.aibolit.annotation.InjectOnFocusChangeListener;
import com.danikula.aibolit.annotation.InjectOnItemClickListener;
import com.danikula.aibolit.annotation.InjectOnItemSelectedListener;
import com.danikula.aibolit.annotation.InjectOnKeyListener;
import com.danikula.aibolit.annotation.InjectOnLongClickListener;
import com.danikula.aibolit.annotation.InjectOnRadioGroupCheckedChangeListener;
import com.danikula.aibolit.annotation.InjectOnTextChangedListener;
import com.danikula.aibolit.annotation.InjectOnTouchListener;
import com.danikula.aibolit.annotation.InjectResource;
import com.danikula.aibolit.annotation.InjectService;
import com.danikula.aibolit.annotation.InjectSystemService;
import com.danikula.aibolit.annotation.InjectView;
/*
 * Copyright (C) 2011 Alexey Danilov
 *
 * 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.danikula.aibolit.injector;



public class InjectorRegister {
    private static final Map<Class<? extends Annotation>, AbstractInjector<?>> INJECTORS_REGISTER;

    private static final List<ServicesResolver> SERVICES_RESOLVERS;

    static {
        SERVICES_RESOLVERS = new LinkedList<ServicesResolver>();
        INJECTORS_REGISTER = new HashMap<Class<? extends Annotation>, AbstractInjector<?>>();

        INJECTORS_REGISTER.put(InjectView.class, new ViewInjector());
        INJECTORS_REGISTER.put(InjectResource.class, new ResourceInjector());
        INJECTORS_REGISTER.put(InjectArrayAdapter.class, new ArrayAdapterInjector());
        INJECTORS_REGISTER.put(InjectSystemService.class, new SystemServiceInjector());
        INJECTORS_REGISTER.put(InjectService.class, new ServiceInjector(SERVICES_RESOLVERS));

        INJECTORS_REGISTER.put(InjectOnClickListener.class, new OnClickListenerInjector());
// Path: library/src/main/java/com/danikula/aibolit/InjectingException.java
// public class InjectingException extends RuntimeException {
// 
//     private static final long serialVersionUID = -1L;
// 
//     public InjectingException(String message) {
//         super(message);
//     }
// 
//     public InjectingException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public InjectingException(Throwable cause) {
//         super(cause);
//     }
// }
// 
// Path: library/src/main/java/com/danikula/aibolit/ServicesResolver.java
// public interface ServicesResolver {
// 
//     /**
//      * Resolves application service by class
//      * 
//      * @param serviceClass Class service's class
//      * @return Object application service
//      */
//     Object resolve(Class<?> serviceClass);
// 
// }
// 
// Path: library/src/main/java/com/danikula/aibolit/Validate.java
// public class Validate {
// 
//     /**
//      * Checks variable on <code>null</code>
//      * 
//      * @param object Object variable to be checked
//      * @param message String message of exception to be throwed if parameter is <code>null</code>
//      * @throws IllegalArgumentException if <code>object</code> is <code>null</code>
//      */
//     public static void notNull(Object object, String message) {
//         if (object == null) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// 
//     /**
//      * Checks contition on <code>true</code>
//      * 
//      * @param condition boolean condition to check
//      * @param message String message of exception to be throwed if condition is not <code>true</code>
//      * @throws IllegalArgumentException if <code>condition</code> is not <code>true</code>
//      */
//     public static void checkTrue(boolean condition, String message) {
//         if (!condition) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// 
// }


// Path: library/src/main/java/com/danikula/aibolit/injector/InjectorRegister.java
import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.danikula.aibolit.InjectingException;
import com.danikula.aibolit.ServicesResolver;
import com.danikula.aibolit.Validate;
import com.danikula.aibolit.annotation.InjectArrayAdapter;
import com.danikula.aibolit.annotation.InjectOnCheckedChangeListener;
import com.danikula.aibolit.annotation.InjectOnClickListener;
import com.danikula.aibolit.annotation.InjectOnCreateContextMenuListener;
import com.danikula.aibolit.annotation.InjectOnEditorActionListener;
import com.danikula.aibolit.annotation.InjectOnFocusChangeListener;
import com.danikula.aibolit.annotation.InjectOnItemClickListener;
import com.danikula.aibolit.annotation.InjectOnItemSelectedListener;
import com.danikula.aibolit.annotation.InjectOnKeyListener;
import com.danikula.aibolit.annotation.InjectOnLongClickListener;
import com.danikula.aibolit.annotation.InjectOnRadioGroupCheckedChangeListener;
import com.danikula.aibolit.annotation.InjectOnTextChangedListener;
import com.danikula.aibolit.annotation.InjectOnTouchListener;
import com.danikula.aibolit.annotation.InjectResource;
import com.danikula.aibolit.annotation.InjectService;
import com.danikula.aibolit.annotation.InjectSystemService;
import com.danikula.aibolit.annotation.InjectView;

/*
 * Copyright (C) 2011 Alexey Danilov
 *
 * 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.danikula.aibolit.injector;



public class InjectorRegister {
    private static final Map<Class<? extends Annotation>, AbstractInjector<?>> INJECTORS_REGISTER;

    private static final List<ServicesResolver> SERVICES_RESOLVERS;

    static {
        SERVICES_RESOLVERS = new LinkedList<ServicesResolver>();
        INJECTORS_REGISTER = new HashMap<Class<? extends Annotation>, AbstractInjector<?>>();

        INJECTORS_REGISTER.put(InjectView.class, new ViewInjector());
        INJECTORS_REGISTER.put(InjectResource.class, new ResourceInjector());
        INJECTORS_REGISTER.put(InjectArrayAdapter.class, new ArrayAdapterInjector());
        INJECTORS_REGISTER.put(InjectSystemService.class, new SystemServiceInjector());
        INJECTORS_REGISTER.put(InjectService.class, new ServiceInjector(SERVICES_RESOLVERS));

        INJECTORS_REGISTER.put(InjectOnClickListener.class, new OnClickListenerInjector());
        INJECTORS_REGISTER.put(InjectOnLongClickListener.class, new OnLongClickListenerInjector());