    001/*
    002 @license.text@
    003  */
    004package com.hammurapi.convert;
    005
    006import com.hammurapi.common.Context;
    007
    008/**
    009 * Part of composite converters which converts one type to another.
    010 * @author Pavel Vlasov
    011 *
    012 * @version $Revision: 1.1 $
    013 */
    014public interface AtomicConverter<S, T> {
    015
    016        /**
    017         * @return Type which converter converts from.
    018         */
    019        Class<S> getSourceType();
    020
    021        /**
    022         * @return Type which converter converts to.
    023         */
    024        Class<? extends T> getTargetType();
    025
    026        /**
    027         * Converts object to target type.
    028         * @param source Source object.
    029         * @param master Master converter to delegate conversion
    030         * of object parts.
    031         * @return Converted object.
    032         */
    033        T convert(S source, Converter master, Context context, ClassLoader classLoader);
    034}