• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JavaScriptLoader类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.ibm.wala.cast.js.loader.JavaScriptLoader的典型用法代码示例。如果您正苦于以下问题:Java JavaScriptLoader类的具体用法?Java JavaScriptLoader怎么用?Java JavaScriptLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

JavaScriptLoader类属于com.ibm.wala.cast.js.loader包,在下文中一共展示了JavaScriptLoader类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: makeHtmlScope

点赞 3

import com.ibm.wala.cast.js.loader.JavaScriptLoader; //导入依赖的package包/类
public static SourceModule[] makeHtmlScope(URL url, JavaScriptLoaderFactory loaders, Function<Void,JSSourceExtractor> fExtractor) {
  Set<Module> scripts = HashSetFactory.make();
  
  JavaScriptLoader.addBootstrapFile(WebUtil.preamble);
  scripts.add(getPrologueFile("prologue.js"));
  scripts.add(getPrologueFile("preamble.js"));

  try {
    scripts.addAll(WebUtil.extractScriptFromHTML(url, fExtractor).fst);
  } catch (Error e) {
    SourceModule dummy = new SourceURLModule(url);
    scripts.add(dummy);
    ((CAstAbstractLoader)loaders.getTheLoader()).addMessage(dummy, e.warning);
  }
      
  SourceModule[] scriptsArray = scripts.toArray(new SourceModule[ scripts.size() ]);
  return scriptsArray;
}
 

开发者ID:wala,
项目名称:WALA-start,
代码行数:19,
代码来源:JSCallGraphBuilderUtil.java

示例2: makeHtmlScope

点赞 3

import com.ibm.wala.cast.js.loader.JavaScriptLoader; //导入依赖的package包/类
public static SourceModule[] makeHtmlScope(URL url, JavaScriptLoaderFactory loaders) {
  Set<SourceModule> scripts = HashSetFactory.make();
  
  JavaScriptLoader.addBootstrapFile(WebUtil.preamble);
  scripts.add(getPrologueFile("prologue.js"));
  scripts.add(getPrologueFile("preamble.js"));

  try {
    scripts.addAll(WebUtil.extractScriptFromHTML(url, true).fst);
  } catch (Error e) {
    SourceModule dummy = new SourceURLModule(url);
    scripts.add(dummy);
    ((CAstAbstractLoader)loaders.getTheLoader()).addMessage(dummy, e.warning);
  }
      
  SourceModule[] scriptsArray = scripts.toArray(new SourceModule[ scripts.size() ]);
  return scriptsArray;
}
 

开发者ID:ylimit,
项目名称:HybridFlow,
代码行数:19,
代码来源:JSCallGraphBuilderUtil.java

示例3: makeHtmlScope

点赞 3

import com.ibm.wala.cast.js.loader.JavaScriptLoader; //导入依赖的package包/类
public static SourceModule[] makeHtmlScope(URL url,
        JavaScriptLoaderFactory loaders) {
    Set<SourceModule> scripts = HashSetFactory.make();

    JavaScriptLoader.addBootstrapFile(WebUtil.preamble);
    scripts.add(getPrologueFile("prologue.js"));
    scripts.add(getPrologueFile("preamble.js"));

    try {
        scripts.addAll(WebUtil.extractScriptFromHTML(url, DefaultSourceExtractor.factory).fst);// TODO
    } catch (Error e) {
        SourceModule dummy = new SourceURLModule(url);
        scripts.add(dummy);
        ((CAstAbstractLoader) loaders.getTheLoader()).addMessage(dummy,
                e.warning);
    }

    SourceModule[] scriptsArray = scripts.toArray(new SourceModule[scripts
                                  .size()]);
    return scriptsArray;
}
 

开发者ID:logicalhacking,
项目名称:DASCA,
代码行数:22,
代码来源:ImprovedJSCallGraphBuilderUtil.java

示例4: removeErrorModules

点赞 2

import com.ibm.wala.cast.js.loader.JavaScriptLoader; //导入依赖的package包/类
private SourceModule[] removeErrorModules(SourceModule[] scriptsArray, JavaScriptLoaderFactory loaders)
        throws IOException, ClassHierarchyException {
    AnalysisScope scope = CAstCallGraphUtil.makeScope(scriptsArray, loaders, JavaScriptLoader.JS);
    IClassHierarchy cha = ClassHierarchy.make(scope, loaders, JavaScriptLoader.JS);
    Set<ModuleEntry> errorModules = new HashSet<>();
    for (IClassLoader loader : cha.getLoaders()) {
        if(loader instanceof CAstAbstractLoader) {
            Iterator errors = ((CAstAbstractLoader)loader).getModulesWithParseErrors();

            while(errors.hasNext()) {
                ModuleEntry errorModule = (ModuleEntry)errors.next();
                errorModules.add(errorModule);
            }

            ((CAstAbstractLoader)loader).clearMessages();
        }
    }

    Set<SourceModule> newSourceModules = new HashSet<>();
    for (SourceModule sourceModule : scriptsArray) {
        boolean isErrorModule = false;
        Iterator<? extends ModuleEntry> moduleEntries = sourceModule.getEntries();
        while (moduleEntries.hasNext()) {
            ModuleEntry moduleEntry = moduleEntries.next();
            if (errorModules.contains(moduleEntry)) {
                isErrorModule = true;
                break;
            }
        }
        if (isErrorModule) {
            continue;
        }
        newSourceModules.add(sourceModule);
    }
    return newSourceModules.toArray(new SourceModule[newSourceModules.size()]);
}
 

开发者ID:ylimit,
项目名称:HybridFlow,
代码行数:37,
代码来源:WebManager.java

示例5: makeScriptScope

点赞 2

import com.ibm.wala.cast.js.loader.JavaScriptLoader; //导入依赖的package包/类
static AnalysisScope makeScriptScope(URL script, String dir, String name,
                                     JavaScriptLoaderFactory loaders) throws IOException {
    return makeScope(new SourceModule[] {
                         (script.openConnection() instanceof JarURLConnection)
                         ? new SourceURLModule(script)
                         : makeSourceModule(script, dir, name),
                         getPrologueFile("prologue.js")
                     }, loaders, JavaScriptLoader.JS);

}
 

开发者ID:logicalhacking,
项目名称:DASCA,
代码行数:11,
代码来源:ImprovedJSCallGraphBuilderUtil.java

示例6: makeScriptScope

点赞 2

import com.ibm.wala.cast.js.loader.JavaScriptLoader; //导入依赖的package包/类
static AnalysisScope makeScriptScope(URL script, String dir, String name, JavaScriptLoaderFactory loaders) throws IOException {
  return makeScope(
      new SourceModule[] { 
          (script.openConnection() instanceof JarURLConnection)? new SourceURLModule(script): makeSourceModule(script, dir, name), 
          getPrologueFile("prologue.js")
      }, loaders, JavaScriptLoader.JS);
  
}
 

开发者ID:blackoutjack,
项目名称:jamweaver,
代码行数:9,
代码来源:JSCallGraphBuilderUtil.java

示例7: get

点赞 2

import com.ibm.wala.cast.js.loader.JavaScriptLoader; //导入依赖的package包/类
public MiniaturTypeData get(CGNode node) {
  Language L = 
    node.getMethod().getDeclaringClass().getClassLoader().getLanguage();
    if (L.equals(Language.JAVA)) {
    return new MiniaturJavaTypeData(node, cha);
  } else if (L.equals(JavaScriptLoader.JS)) {
    return new MiniaturJavaScriptTypeData(node, PA);
  } else {
    Assertions.UNREACHABLE();
    return null;
  }
}
 

开发者ID:wala,
项目名称:MemSAT,
代码行数:13,
代码来源:MiniaturTypeDataFactory.java

示例8: makeScriptScope

点赞 2

import com.ibm.wala.cast.js.loader.JavaScriptLoader; //导入依赖的package包/类
public static AnalysisScope makeScriptScope(String dir, String name, JavaScriptLoaderFactory loaders, ClassLoader loader) throws IOException {
  return makeScope(makeSourceModules(dir, name, loader), loaders, JavaScriptLoader.JS);    
}
 

开发者ID:wala,
项目名称:WALA-start,
代码行数:4,
代码来源:JSCallGraphBuilderUtil.java

示例9: makeCGBuilder

点赞 2

import com.ibm.wala.cast.js.loader.JavaScriptLoader; //导入依赖的package包/类
public static JSCFABuilder makeCGBuilder(JavaScriptLoaderFactory loaders, SourceModule[] scripts, CGBuilderType builderType, IRFactory<IMethod> irFactory) throws IOException, WalaException {
  AnalysisScope scope = makeScope(scripts, loaders, JavaScriptLoader.JS);
  return makeCG(loaders, scope, builderType, irFactory);
}
 

开发者ID:wala,
项目名称:WALA-start,
代码行数:5,
代码来源:JSCallGraphBuilderUtil.java

示例10: makeCGBuilder

点赞 2

import com.ibm.wala.cast.js.loader.JavaScriptLoader; //导入依赖的package包/类
public static JSCFABuilder makeCGBuilder(JavaScriptLoaderFactory loaders,
        SourceModule[] scripts, CGBuilderType builderType,
        IRFactory<IMethod> irFactory) throws IOException, WalaException {
    AnalysisScope scope = makeScope(scripts, loaders, JavaScriptLoader.JS);
    return makeCG(loaders, scope, builderType, irFactory);
}
 

开发者ID:logicalhacking,
项目名称:DASCA,
代码行数:7,
代码来源:ImprovedJSCallGraphBuilderUtil.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)