📄 configconverter.java
字号:
package xyz.frame.config;import xyz.frame.component.ComponentInstantiationException;import xyz.frame.converter.Converter;import xyz.frame.util.ReflectionUtil;import xyz.frame.webapp.DefaultWebApplication;/** * Models the xml portion to deal with component classes * * @author Guilherme Silveira */public class ConfigConverter implements ConfigItem { private Class<? extends Converter> converterClazz; /** * Creates a configuration converter * * @param <T> * the converter type * @param clazz * the class type */ @SuppressWarnings("unchecked") public <T> ConfigConverter(Class<T> clazz) { super(); this.converterClazz = (Class<? extends Converter>) clazz; } public Class<?> getConverterClass() { return converterClazz; } /** * Registers itself * * @throws ConfigException * * @see xyz.frame.config.ConfigItem#register(xyz.frame.webapp.DefaultWebApplication) */ public void register(DefaultWebApplication application) throws ConfigException { try { application.getConverterManager().register( ReflectionUtil.instantiate(this.converterClazz)); } catch (ComponentInstantiationException e) { throw new ConfigException(e.getMessage(), e); } } /** * * @see xyz.frame.config.ConfigItem#isComponent() */ public boolean isComponent() { return true; } /** * * @see xyz.frame.config.ConfigItem#isManager() */ public boolean isManager() { return false; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -