obj.java

来自「一个简单的visio程序。」· Java 代码 · 共 60 行

JAVA
60
字号
package HAB.HcBean;

import java.lang.reflect.*;
import HPCore.Exception.HpException;
import HAB.HcBean.HalcyonAppletBeanInterface;

public class Obj 
{
    public static Object CreateObject(String obj) throws HpException 
	{
     try
	  {
        return CreateObject(null,obj);
      }
	 catch(Exception he)
	  {
        throw new HpException(0,"Couldn't instanceof  "+obj);
      }
    }

    public static Object CreateObject(java.awt.Container con,String obj) throws HpException 
	{
	  Object returnObj = null;
      try
	   {
	     Class c = Class.forName(obj);
	     if (c != null)
	     {
	       returnObj = c.newInstance();
	     }
	   }
	 catch (Throwable ex)
	   {
        throw new HpException(0,"Couldn't instanceof  "+obj);
	   }

	 if (returnObj == null)
	 {
	   throw new HpException(0,"Couldn't instanceof  "+obj);
	 }

	 if (returnObj instanceof HalcyonAppletBeanInterface)
	 {
	   return returnObj;
	 }
	 else
	 {
	  try
	  {
	   java.beans.BeanInfo bi = java.beans.Introspector.getBeanInfo(returnObj.getClass());
	  }
	  catch (Throwable ex)
	  {
	    throw new HpException(0,"Couldn't instanceof  "+obj);
	  }
	  return returnObj;
	 }
   }
}

⌨️ 快捷键说明

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