/*
 @license.text@
  */
package com.hammurapi.convert;

import com.hammurapi.common.Context;

/**
 * Part of composite converters which converts one type to another.
 * @author Pavel Vlasov
 *
 * @version $Revision: 1.1 $
 */
public interface AtomicConverter<S, T> {
	
	/**
	 * @return Type which converter converts from.
	 */
	Class<S> getSourceType();
	
	/**
	 * @return Type which converter converts to.
	 */
	Class<? extends T> getTargetType();
	
	/**
	 * Converts object to target type.
	 * @param source Source object.
	 * @param master Master converter to delegate conversion 
	 * of object parts.
	 * @return Converted object.
	 */
	T convert(S source, Converter master, Context context, ClassLoader classLoader);
}
