001package com.hammurapi.convert; 002 003/** 004 * Base class for atomic converters. 005 * @author Pavel 006 * 007 */ 008public abstract class AtomicConverterBase<S, T> implements AtomicConverter<S, T> { 009 010 protected Class<S> sourceType; 011 protected Class<T> targetType; 012 013 public Class<S> getSourceType() { 014 return sourceType; 015 } 016 017 public Class<T> getTargetType() { 018 return targetType; 019 } 020 021 public AtomicConverterBase(Class<S> sourceType, Class<T> targetType) { 022 super(); 023 this.sourceType = sourceType; 024 this.targetType = targetType; 025 } 026 027 public String toString() { 028 return "AtomicConverter of "+sourceType+" (loaded by "+sourceType.getClassLoader()+") to "+targetType+" (loaded by "+targetType.getClassLoader()+")"; 029 } 030}