factorymanager.java
来自「pojo的mvc框架」· Java 代码 · 共 50 行
JAVA
50 行
package xyz.frame.factory;import xyz.frame.LogicRequest;import xyz.frame.component.InvalidComponentException;import xyz.frame.introspector.Introspector;/** * Responsible for dealing with factories * * @author Guilherme Silveira */public interface FactoryManager { /** * Instatiates an object based on a key by first instantiating the factory, * injecting what is needed and then calling the create method * * @param key * factory key * @param context * logic context * @return the new object * @exception FactoryException * if unable to instantiate such key (key does not exist or * some internal exception) */ public Object instantiate(String key, LogicRequest context, Introspector introspector) throws FactoryException; /** * Whether this factory can deal with this key * * @param key * key * @return true or false */ public boolean canInstantiate(String key); /** * Registers a factory * * @param clazz * the class * @throws InvalidComponentException * invalid factory if some of it's methods are invalid */ public void register(Class clazz) throws InvalidFactoryException;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?