Exemple #1
0
 /** 获得类名称中的对象名 */
 public static String getObjectName(String className) {
   int li_StartPos = StringL.lastIndexOf(className, ".");
   if (StringL.indexOf(className, "(") >= 0)
     li_StartPos =
         StringL.lastIndexOf(StringL.left(className, StringL.lastIndexOf(className, ".")), ".");
   String ls_ObjectName = StringL.substring(className, li_StartPos + 1);
   if (StringL.indexOf(ls_ObjectName, ".") > 0)
     ls_ObjectName = StringL.left(ls_ObjectName, StringL.indexOf(ls_ObjectName, "."));
   return ls_ObjectName;
 }
Exemple #2
0
 /** 获得类名称中的包名 */
 public static String getPackageName(String className) {
   int li_PosOfComma = StringL.lastIndexOf(className, ".");
   String ls_PackageName = null;
   if (li_PosOfComma >= 0) {
     ls_PackageName = StringL.left(className, li_PosOfComma);
     if (StringL.indexOf(className, "(") >= 0)
       ls_PackageName = StringL.left(ls_PackageName, StringL.lastIndexOf(ls_PackageName, "."));
   }
   return ls_PackageName;
 }