// Path: src/main/java/com/github/vbauer/herald/logger/LogFactory.java
// public interface LogFactory {
// 
//     /**
//      * Check if logger class is compatible with the log factory.
//      *
//      * @param loggerClass logger class
//      * @return true if compatible and false - otherwise
//      */
//     boolean isCompatible(Class<?> loggerClass);
// 
//     /**
//      * Create logger with the given name (as configuration parameter).
//      *
//      * @param name logger name
//      * @return logger instance
//      */
//     Object createLogger(String name);
// 
//     /**
//      * Create logger with the given class (as configuration parameter).
//      *
//      * @param clazz class
//      * @return logger instance
//      */
//     Object createLogger(Class<?> clazz);
// 
// }
// 
// Path: src/main/java/com/github/vbauer/herald/util/ReflectionUtils.java
// public final class ReflectionUtils {
// 
//     private ReflectionUtils() {
//         throw new UnsupportedOperationException();
//     }
// 
// 
//     public static boolean isAssignableFrom(final String className, final Class<?> from) {
//         try {
//             final Class<?> clazz = Class.forName(className);
//             return clazz.isAssignableFrom(from);
//         } catch (final Throwable ex) {
//             return false;
//         }
//     }
// 
//     @SuppressWarnings("unchecked")
//     public  static <I, O> O invokeStatic(final String className, final String methodName, final I argument) {
//         try {
//             final Class<?> clazz = Class.forName(className);
//             final Class<?> argumentClass = argument.getClass();
// 
//             final Method method = clazz.getDeclaredMethod(methodName, argumentClass);
//             return (O) method.invoke(null, argument);
//         } catch (final Exception ex) {
//             return handleReflectionException(ex);
//         }
//     }
// 
//     public static <T> T handleReflectionException(final Throwable ex) {
//         if (ex instanceof RuntimeException) {
//             throw (RuntimeException) ex;
//         } else if (ex instanceof Error) {
//             throw (Error) ex;
//         }
//         throw new RuntimeException(ex);
//     }
// 
//     public static <T extends Annotation> T findAnnotation(
//         final Class<T> annotationClass, final Class<?> beanClass, final Field field
//     ) {
//         final T fieldAnnotation = field.getAnnotation(annotationClass);
//         return fieldAnnotation == null ? beanClass.getAnnotation(annotationClass) : fieldAnnotation;
//     }
// 
//     public static boolean setAccessible(final AccessibleObject object, final boolean accessible) {
//         try {
//             object.setAccessible(accessible);
//             return true;
//         } catch (final Throwable ignored) {
//             // Ignored.
//             return false;
//         }
//     }
// 
// }


import com.github.vbauer.herald.logger.LogFactory;
import com.github.vbauer.herald.util.ReflectionUtils;
package com.github.vbauer.herald.logger.impl;


/**
 * @author Vladislav Bauer
 */

public abstract class SimpleLogFactory implements LogFactory {

    private final String loggerClassName;
    private final String loggerFactoryClassName;
    private final String loggerFactoryMethod;
    
            
    protected SimpleLogFactory(
        final String loggerClassName,
        final String loggerFactoryClassName, final String loggerFactoryMethod
    ) {
        this.loggerClassName = loggerClassName;
        this.loggerFactoryClassName = loggerFactoryClassName;
        this.loggerFactoryMethod = loggerFactoryMethod;
    }


    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isCompatible(final Class<?> loggerClass) {
// Path: src/main/java/com/github/vbauer/herald/logger/LogFactory.java
// public interface LogFactory {
// 
//     /**
//      * Check if logger class is compatible with the log factory.
//      *
//      * @param loggerClass logger class
//      * @return true if compatible and false - otherwise
//      */
//     boolean isCompatible(Class<?> loggerClass);
// 
//     /**
//      * Create logger with the given name (as configuration parameter).
//      *
//      * @param name logger name
//      * @return logger instance
//      */
//     Object createLogger(String name);
// 
//     /**
//      * Create logger with the given class (as configuration parameter).
//      *
//      * @param clazz class
//      * @return logger instance
//      */
//     Object createLogger(Class<?> clazz);
// 
// }
// 
// Path: src/main/java/com/github/vbauer/herald/util/ReflectionUtils.java
// public final class ReflectionUtils {
// 
//     private ReflectionUtils() {
//         throw new UnsupportedOperationException();
//     }
// 
// 
//     public static boolean isAssignableFrom(final String className, final Class<?> from) {
//         try {
//             final Class<?> clazz = Class.forName(className);
//             return clazz.isAssignableFrom(from);
//         } catch (final Throwable ex) {
//             return false;
//         }
//     }
// 
//     @SuppressWarnings("unchecked")
//     public  static <I, O> O invokeStatic(final String className, final String methodName, final I argument) {
//         try {
//             final Class<?> clazz = Class.forName(className);
//             final Class<?> argumentClass = argument.getClass();
// 
//             final Method method = clazz.getDeclaredMethod(methodName, argumentClass);
//             return (O) method.invoke(null, argument);
//         } catch (final Exception ex) {
//             return handleReflectionException(ex);
//         }
//     }
// 
//     public static <T> T handleReflectionException(final Throwable ex) {
//         if (ex instanceof RuntimeException) {
//             throw (RuntimeException) ex;
//         } else if (ex instanceof Error) {
//             throw (Error) ex;
//         }
//         throw new RuntimeException(ex);
//     }
// 
//     public static <T extends Annotation> T findAnnotation(
//         final Class<T> annotationClass, final Class<?> beanClass, final Field field
//     ) {
//         final T fieldAnnotation = field.getAnnotation(annotationClass);
//         return fieldAnnotation == null ? beanClass.getAnnotation(annotationClass) : fieldAnnotation;
//     }
// 
//     public static boolean setAccessible(final AccessibleObject object, final boolean accessible) {
//         try {
//             object.setAccessible(accessible);
//             return true;
//         } catch (final Throwable ignored) {
//             // Ignored.
//             return false;
//         }
//     }
// 
// }


// Path: src/main/java/com/github/vbauer/herald/logger/impl/SimpleLogFactory.java
import com.github.vbauer.herald.logger.LogFactory;
import com.github.vbauer.herald.util.ReflectionUtils;

package com.github.vbauer.herald.logger.impl;


/**
 * @author Vladislav Bauer
 */

public abstract class SimpleLogFactory implements LogFactory {

    private final String loggerClassName;
    private final String loggerFactoryClassName;
    private final String loggerFactoryMethod;
    
            
    protected SimpleLogFactory(
        final String loggerClassName,
        final String loggerFactoryClassName, final String loggerFactoryMethod
    ) {
        this.loggerClassName = loggerClassName;
        this.loggerFactoryClassName = loggerFactoryClassName;
        this.loggerFactoryMethod = loggerFactoryMethod;
    }


    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isCompatible(final Class<?> loggerClass) {
        return ReflectionUtils.isAssignableFrom(loggerClassName, loggerClass);