本文整理汇总了Java中org.seasar.framework.util.ClassUtil.forName方法的典型用法代码示例。如果您正苦于以下问题:Java ClassUtil.forName方法的具体用法?Java ClassUtil.forName怎么用?Java ClassUtil.forName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.seasar.framework.util.ClassUtil
的用法示例。
在下文中一共展示了ClassUtil.forName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGeneratorClass
import org.seasar.framework.util.ClassUtil; //导入方法依赖的package包/类
protected static Class getGeneratorClass(String name) {
Class clazz = (Class) generatorClasses.get(name);
if (clazz != null) {
return clazz;
}
return ClassUtil.forName(name);
}
示例2: getAdapter
import org.seasar.framework.util.ClassUtil; //导入方法依赖的package包/类
private static Adapter getAdapter() {
try {
ClassUtil.forName("org.seasar.framework.env.Env");
} catch (ClassNotFoundRuntimeException ignore) {
return new AdapterS23();
}
return new AdapterS24();
}
示例3: AdapterS24
import org.seasar.framework.util.ClassUtil; //导入方法依赖的package包/类
private AdapterS24() {
selectableDataSourceProxyClass = ClassUtil
.forName("org.seasar.extension.datasource.impl.SelectableDataSourceProxy");
try {
dataSourceFactoryField = selectableDataSourceProxyClass
.getDeclaredField("dataSourceFactory");
} catch (NoSuchFieldException ex) {
throw new NoSuchFieldRuntimeException(
selectableDataSourceProxyClass, "dataSourceFactory", ex);
}
dataSourceFactoryField.setAccessible(true);
getSelectableDataSourceNameMethod = ClassUtil.getMethod(
dataSourceFactoryField.getType(),
"getSelectableDataSourceName", null);
}
示例4: init
import org.seasar.framework.util.ClassUtil; //导入方法依赖的package包/类
public void init() {
Class clazz = ResultSetHandlerFactoryImpl.class;
try {
clazz = ClassUtil.forName(TIGER_RESULT_SET_HANDLER_FACTORY);
} catch (ClassNotFoundRuntimeException ignore) {
}
ResultSetHandlerFactoryImpl factory = (ResultSetHandlerFactoryImpl) ClassUtil
.newInstance(clazz);
factory.setDtoMetaDataFactory(dtoMetaDataFactory);
factory.setRestrictNotSingleResult(restrictNotSingleResult);
resultSetHandlerFactory = factory;
}
示例5: AnnotationReaderFactoryImpl
import org.seasar.framework.util.ClassUtil; //导入方法依赖的package包/类
public AnnotationReaderFactoryImpl() {
Class clazz = FieldAnnotationReaderFactory.class;
try {
clazz = ClassUtil.forName(TIGER_ANNOTATION_READER_FACTORY);
} catch (ClassNotFoundRuntimeException ignore1) {
try {
clazz = ClassUtil
.forName(BACKPORT175_ANNOTATION_READER_FACTORY);
} catch (ClassNotFoundRuntimeException ignore2) {
}
}
annotationReaderFactory = (AnnotationReaderFactory) ClassUtil
.newInstance(clazz);
}
示例6: AdapterS23
import org.seasar.framework.util.ClassUtil; //导入方法依赖的package包/类
private AdapterS23() {
selectableDataSourceProxyClass = ClassUtil
.forName("org.seasar.extension.component.impl.SelectableDataSourceProxy");
getDataSourceNameMethod = ClassUtil.getMethod(
selectableDataSourceProxyClass, "getDataSourceName", null);
}