package de.skuzzle.inject.conf;

public interface TextContentType {

    <T> T createInstance(Class<T> type, TextResource resource);
}

package de.skuzzle.inject.conf;

import de.skuzzle.inject.conf.Resources.ChoseTargetType;

/**
 * This interfaces controls how the content of a {@link TextResource} is mapped
 * to a concrete instance of some object.
 *
 * @author Simon Taddiken
 */
public interface TextContentType {

    /**
     * Creates an instance of type T from the given resource. The type that is
     * passed here, is the one that the user passed to
     * {@link ChoseTargetType#to(Class)} when binding a resource.
     *
     * <T> The result type.
     *
     * @param type The type to create an instance of.
     * @param resource The resource to create an instance from.
     * @return The created Object.
     */
    <T> T createInstance(Class<T> type, TextResource resource);
}

Add comment