⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configruleset.java.svn-base

📁 MVC开源框架
💻 SVN-BASE
📖 第 1 页 / 共 2 页
字号:
        }        if (attributes.getIndex("property") != -1) {            throw new IllegalArgumentException(                "<set-property> accepts only one of 'key' or 'property' attributes.");        }        Object topOfStack = digester.peek();        if (topOfStack instanceof BaseConfig) {            BaseConfig config = (BaseConfig) topOfStack;            config.setProperty(attributes.getValue("key"),                attributes.getValue("value"));        } else {            throw new IllegalArgumentException(                "'key' attribute of <set-property> only applicable to subclasses of BaseConfig; "                + "object on top of stack is " + topOfStack + " [key: "                + attributes.getValue("key") + ", value: "                + attributes.getValue("value") + "]");        }    }}/** * <p> An object creation factory which creates action form bean instances, * taking into account the default class name, which may have been specified * on the parent element and which is made available through the object on the * top of the stack, which must be a <code>org.apache.struts.config.ModuleConfig</code>. * </p> */final class ActionFormBeanFactory extends AbstractObjectCreationFactory {    private ClassLoader cl;    public ActionFormBeanFactory(ClassLoader cl) {        super();        this.cl = cl;    }    public Object createObject(Attributes attributes) {        // Identify the name of the class to instantiate        String className = attributes.getValue("className");        if (className == null) {            ModuleConfig mc = (ModuleConfig) digester.peek();            className = mc.getActionFormBeanClass();        }        // Instantiate the new object and return it        Object actionFormBean = null;        try {            actionFormBean = RequestUtils.applicationInstance(className, cl);        } catch (Exception e) {            digester.getLogger().error("ActionFormBeanFactory.createObject: ", e);        }        return actionFormBean;    }}/** * <p> Class that sets the name of the class to use when creating action * mapping instances. The value is set on the object on the top of the stack, * which must be a <code>org.apache.struts.config.ModuleConfig</code>. </p> */final class SetActionMappingClassRule extends Rule {    public SetActionMappingClassRule() {        super();    }    public void begin(String namespace, String name, Attributes attributes)        throws Exception {        String className = attributes.getValue("type");        if (className != null) {            ModuleConfig mc = (ModuleConfig) digester.peek();            mc.setActionMappingClass(className);        }    }}/** * <p> An object creation factory which creates action mapping instances, * taking into account the default class name, which may have been specified * on the parent element and which is made available through the object on the * top of the stack, which must be a <code>org.apache.struts.config.ModuleConfig</code>. * </p> */final class ActionMappingFactory extends AbstractObjectCreationFactory {    private ClassLoader cl;    public ActionMappingFactory(ClassLoader cl) {        super();        this.cl = cl;    }    public Object createObject(Attributes attributes) {        // Identify the name of the class to instantiate        String className = attributes.getValue("className");        if (className == null) {            ModuleConfig mc = (ModuleConfig) digester.peek();            className = mc.getActionMappingClass();        }        // Instantiate the new object and return it        Object actionMapping = null;        try {            actionMapping = RequestUtils.applicationInstance(className, cl);        } catch (Exception e) {            digester.getLogger().error("ActionMappingFactory.createObject: ", e);        }        return actionMapping;    }}/** * <p> Class that sets the name of the class to use when creating global * forward instances. The value is set on the object on the top of the stack, * which must be a <code>org.apache.struts.config.ModuleConfig</code>. </p> */final class SetActionForwardClassRule extends Rule {    public SetActionForwardClassRule() {        super();    }    public void begin(String namespace, String name, Attributes attributes)        throws Exception {        String className = attributes.getValue("type");        if (className != null) {            ModuleConfig mc = (ModuleConfig) digester.peek();            mc.setActionForwardClass(className);        }    }}/** * <p> An object creation factory which creates global forward instances, * taking into account the default class name, which may have been specified * on the parent element and which is made available through the object on the * top of the stack, which must be a <code>org.apache.struts.config.ModuleConfig</code>. * </p> */final class GlobalForwardFactory extends AbstractObjectCreationFactory {    private ClassLoader cl;    public GlobalForwardFactory(ClassLoader cl) {        super();        this.cl = cl;    }    public Object createObject(Attributes attributes) {        // Identify the name of the class to instantiate        String className = attributes.getValue("className");        if (className == null) {            ModuleConfig mc = (ModuleConfig) digester.peek();            className = mc.getActionForwardClass();        }        // Instantiate the new object and return it        Object globalForward = null;        try {            globalForward = RequestUtils.applicationInstance(className, cl);        } catch (Exception e) {            digester.getLogger().error("GlobalForwardFactory.createObject: ", e);        }        return globalForward;    }}/** * <p> An object creation factory which creates action forward instances, * taking into account the default class name, which may have been specified * on the parent element and which is made available through the object on the * top of the stack, which must be a <code>org.apache.struts.config.ModuleConfig</code>. * </p> */final class ActionForwardFactory extends AbstractObjectCreationFactory {    private ClassLoader cl;    public ActionForwardFactory(ClassLoader cl) {        super();        this.cl = cl;    }    public Object createObject(Attributes attributes) {        // Identify the name of the class to instantiate        String className = attributes.getValue("className");        if (className == null) {            ModuleConfig mc = (ModuleConfig) digester.peek(1);            className = mc.getActionForwardClass();        }        // Instantiate the new object and return it        Object actionForward = null;        try {            actionForward = RequestUtils.applicationInstance(className, cl);        } catch (Exception e) {            digester.getLogger().error("ActionForwardFactory.createObject: ", e);        }        return actionForward;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -