OSDN Git Service

initial commit
[xdf/git-repos.git] / xdf / src / main / java / jp / ac / aiit / xdf / core / typeconvert / InstanciationConverter.java
1 package jp.ac.aiit.xdf.core.typeconvert;
2
3 import jp.ac.aiit.xdf.utils.Reflections;
4
5 /**
6  * 指定された文字列をFQCNとして扱い、デフォルトコンストラクタによってインスタンスを生成する。
7  * 
8  * @author Tagaki
9  * @param <T> 生成されるインスタンスの型
10  */
11 public class InstanciationConverter<T> implements TypeConverter<T> {
12
13         @SuppressWarnings("unchecked")
14         @Override
15         public T apply(String target) {
16                 return (T) Reflections.getInstance(target);
17         }
18
19         @Override
20         public boolean isAppliable(String target) {
21                 return true;
22         }
23
24 }