Package com.google.code.vimsztool.compiler

Examples of com.google.code.vimsztool.compiler.CompilerContext


  @Override
  public String execute() {
    String classPathXml = params.get(SzjdeConstants.PARAM_CLASSPATHXML);
    String currentPkg = params.get(SzjdeConstants.PARAM_PKG_NAME);
    String[] varNames = params.get(SzjdeConstants.PARAM_VAR_NAMES).split(",");
    CompilerContext ctx = getCompilerContext(classPathXml);
    PackageInfo packageInfo =ctx.getPackageInfo();
   
    StringBuilder sb = new StringBuilder();
    for (String varName : varNames ) {
      varName = varName.trim();
      if (isKeyword(varName)) continue;
View Full Code Here


    Location loc = event.location();
    Debugger debugger = Debugger.getInstance();
    String className = loc.declaringType().name();
    int lineNum = loc.lineNumber();

    CompilerContext ctx = debugger.getCompilerContext();
    String abPath = "None";
    try {
      abPath = ctx.findSourceFile(loc.sourcePath());
    } catch (Throwable e) {
    }
   
    String funcName = "HandleJdiEvent";
    String[] args = {"suspend", abPath, String.valueOf(lineNum), className };
View Full Code Here

    String srcPath = params.get(SzjdeConstants.PARAM_SOURCEFILE);
   
    File file = new File(classPathXml);
    if (file.isDirectory()) return "";
   
    CompilerContext cc=getCompilerContext(classPathXml);
    String dstPath = cc.getResourceDistFile(srcPath);
    //srcPath not under any configured source path in .class xml
    if (dstPath == null) return "";
    File srcFile = new File(srcPath);
    File dstFile = new File(dstPath);
    try {
View Full Code Here

public class SzjdeLoadJarMetaInfoCommand extends SzjdeCommand {

  public String execute() {
    String classPathXml = params.get(SzjdeConstants.PARAM_CLASSPATHXML);
    CompilerContext ctx = getCompilerContext(classPathXml);
    List<URL> urls = ctx.getClassPathUrls();
    ClassMetaInfoManager cmm = ctx.getClassMetaInfoManager();
   
    for (URL url : urls) {
      String path = url.getPath();
      if (path.endsWith(".jar")) {
        cmm.loadMetaInfoInJar(path);
View Full Code Here

   
    //FIXME: handle inner class here.
    String className = aClass.getCanonicalName();
   
    String sourceType = params.get(SzjdeConstants.PARAM_SOURCE_TYPE);
    CompilerContext cc = getCompilerContext(classPathXml);

    if (sourceType != null && sourceType.equals("impl")) {
      ClassMetaInfoManager cmm = cc.getClassMetaInfoManager();
      ClassInfo classInfo = cmm.getMetaInfo(className);
      if (classInfo != null) {
        Set<String> subNames = classInfo.getSubNames();
        if (subNames.size() == 1) {
          className = subNames.toArray(new String[]{})[0];
        }
      }
    }

    String sourcePath = cc.findSourceClass(className);
    return sourcePath;
  }
View Full Code Here

    }
    return "";
  }
  public String completeClass(String classPathXml, String nameStart,boolean ignoreCase) {
    if (classPathXml ==null || nameStart == null) return "";
    CompilerContext ctx = getCompilerContext(classPathXml);
    PackageInfo packageInfo = ctx.getPackageInfo();
    List<String> classNameList = null;
    if (nameStart.length() < 2) {
      return "";
    }
    if (nameStart.indexOf(".") > -1) {
View Full Code Here

  }
 
 
 
  public String completePackage(String classPathXml, String pkgname) {
    CompilerContext ctx = getCompilerContext(classPathXml);
    ReflectAbleClassLoader classLoader = ctx.getClassLoader();
    PackageInfo packageInfo = ctx.getPackageInfo();
    List<String> subNames=packageInfo.getClassesForPackage(pkgname, classLoader);
    StringBuilder sb=new StringBuilder();
    for (String name : subNames) {
      sb.append(name).append("\n");
    }
View Full Code Here

  private static JdeLogger log = JdeLogger.getLogger("SzjdeCompilerCommand");
 
  public String execute() {
    String classPathXml = params.get(SzjdeConstants.PARAM_CLASSPATHXML);
    String sourceFile = params.get(SzjdeConstants.PARAM_SOURCEFILE);
    CompilerContext cc=getCompilerContext(classPathXml);
    JDTCompiler compiler =new JDTCompiler(cc);
    String[] allSrcFiles = new String[] {};
    if (sourceFile.equals("All")) {
      allSrcFiles = cc.getAllSourceFiles();
    } else {
      ClassMetaInfoManager metaInfoManager = cc.getClassMetaInfoManager();
      String targetClassName=cc.buildClassName(sourceFile);
      Set<String> dependentClasses = metaInfoManager.getDependentClasses(targetClassName);
      List<String> srcFileList = new ArrayList<String>();
      for (String depClass : dependentClasses ) {
        String rtlPathName = depClass.replace(".", "/") + ".java";
        String sourcePath = cc.findSourceFileInSrcPath(rtlPathName);
        if (sourcePath != null ) {
          srcFileList.add(sourcePath);
        }
      }
      if (!srcFileList.contains(sourceFile)) {
View Full Code Here

  }
 
  @SuppressWarnings("rawtypes")
  public static Class getExistedClass(String classPathXml , String[] classNameList,String sourceFile) {
    CompilerContextManager ccm = CompilerContextManager.getInstnace();
    CompilerContext ctx = ccm.getCompilerContext(classPathXml);
    ReflectAbleClassLoader classLoader = ctx.getClassLoader();
    Class aClass = null;
   
    for (String className : classNameList) {
      if (className.equals("this") && sourceFile !=null ) {
        className = ctx.buildClassName(sourceFile);
      }
      try {
        aClass = classLoader.loadClass(className);
      } catch (ClassNotFoundException e) {
        try {
          aClass = classLoader.loadClass("java.lang."+className);
        } catch (ClassNotFoundException e2) {
          try {
            String mainClass = ctx.buildClassName(sourceFile);
            aClass = classLoader.loadClass(mainClass+"$"+className);
          } catch (ClassNotFoundException e3) { }
        }
      }
      if (aClass != null) break;
View Full Code Here

    String classPathXml = params.get(SzjdeConstants.PARAM_CLASSPATHXML);
    String srcPath = params.get(SzjdeConstants.PARAM_SOURCEFILE);
    String memberDesc = params.get(SzjdeConstants.PARAM_MEMBER_DESC);
    File file = new File(classPathXml);
    if (file.isDirectory()) return "";
    CompilerContext ctx=getCompilerContext(classPathXml);
    String targetClass= ctx.buildClassName(srcPath);
    targetClass = targetClass.replace(".", "/");
    String result = search(ctx,targetClass,memberDesc);
    return result;
  }
View Full Code Here

TOP

Related Classes of com.google.code.vimsztool.compiler.CompilerContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.