Пример #1
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;
 }
Пример #2
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;
 }
Пример #3
0
 /**
  * 组合文件名
  *
  * @param FilePath
  * @param sFileName
  * @return
  * @throws IOException
  */
 public static String getFullName(String FilePath, String sFileName) {
   File dFile = null;
   String sFullPath = FilePath;
   if (sFullPath != null) {
     dFile = new File(sFullPath);
     if (!dFile.exists()) {
       LogL.getInstance().getLog().debug("at FileUtils.getFullName: 文件目录[" + dFile + "]不存在!!!");
     }
     if (sFileName.startsWith("/") && !sFullPath.endsWith("/")
         || !sFileName.startsWith("/") && sFullPath.endsWith("/")) {
       sFullPath = sFullPath + sFileName;
     } else if (sFileName.startsWith("/") && sFullPath.endsWith("/")) {
       sFullPath = sFullPath + sFileName.substring(1);
     } else {
       sFullPath = sFullPath + "/" + sFileName;
     }
     dFile = new File(sFullPath);
     if (!dFile.exists()) {
       LogL.getInstance()
           .getLog()
           .error("at FileUtils.getFullName: 组合后文件[" + sFullPath + "]不存在!!!");
     }
   } else {
     LogL.getInstance()
         .getLog()
         .error("at FileUtils.getFullName: 文件 [" + FilePath + "]为空(null)!!!");
   }
   return StringL.convert2Reg(sFullPath);
 }
Пример #4
0
 public void atStringL(StringL s) throws CompileError {
   exprType = CLASS;
   arrayDim = 0;
   className = jvmJavaLangString;
   bytecode.addLdc(s.get());
 }