zoukankan      html  css  js  c++  java
  • 创建classic 得到函数 调用函数

    Class manager = null;

            try
            {
                //1. 创建class
                manager = Class.forName(name);
            }
            catch (ClassNotFoundException e)
            {
             }

            Method oMethod = null;

            try
            {
                //2. 得到函数
                oMethod = manager.getMethod("getInstance", null);
            }
            catch (Exception e)
            {
             }

           IInitializable initializable = null;

            try
            {
                //3. 调用函数
                initializable = (IInitializable) oMethod.invoke(null, null);
            }
            catch (Exception e)
            {
            }

            try
            {
                initializable.init(xmlStatic);
            }
            catch (Throwable e)
            {
             if (blockingError)
                {
                    FatalHandler.manage(this, CoreMessages.format("BSSE0004", name),e);
                }
             else
                {
                 logger.warn(CoreMessages.format("BSSE0004", name));
                 logger.error(e);
                }
                return;
            }

  • 相关阅读:
    Codeblocks的常用Debug快捷键
    大整数乘法(POJ2389)
    简单深搜
    Windows安装时的几个命令(摘录)
    模拟栈的回溯,完全二叉树搜索,(ZOJ1004)
    生理周期,POJ(1006)
    next_permutation,POJ(1256)
    计算次数,POJ(1207)
    模拟,找次品硬币,Counterfeit Dollar(POJ 1013)
    深搜(DFS),Image Perimeters
  • 原文地址:https://www.cnblogs.com/kevinge/p/1549632.html
Copyright © 2011-2022 走看看