Tabnine Logo
V8Engine
Code IndexAdd Tabnine to your IDE (free)

How to use
V8Engine
in
org.jooby.assets

Best Java code snippets using org.jooby.assets.V8Engine (Showing top 15 results out of 315)

origin: jooby-project/jooby

@Override
public String process(final String filename, final String source, final Config conf,
  final ClassLoader loader) throws Exception {
 String path = filename.startsWith("/") ? filename.substring(1) : filename;
 return engine(V8Engine.class)
   .execute("r.js", source, options(), path);
}
origin: jooby-project/jooby

public V8Object hash() {
 return hash(v8);
}
origin: jooby-project/jooby

public String execute(final String path, final Object... args) throws Exception {
 V8Function fn = register(v8, (V8Function) load(path));
 V8Array arguments = array(Arrays.asList(args));
 Object value = null;
 try {
  value = register(v8, fn.call(v8, arguments));
  if (value instanceof String) {
   return value.toString();
  }
  List<AssetProblem> problems = problems(value);
  if (problems.size() > 0) {
   throw new AssetException(id, problems);
  }
  return ((V8Object) value).getString("output");
 } finally {
  releaseNow(value);
  releaseNow(arguments);
  releaseNow(fn);
 }
}
origin: jooby-project/jooby

V8 v8 = engine.v8;
V8Object j2v8 = engine.hash();
j2v8.add("createFilter", engine.function((receiver, args) -> {
 List<PathMatcher> includes = filter(args, 0).stream()
   .map(it -> FileSystems.getDefault().getPathMatcher("glob:" + it))
 return engine.function((self, arguments) -> {
  Path path = Paths.get(arguments.get(0).toString());
  if (includes.stream().filter(it -> it.matches(path)).findFirst().isPresent()) {
log.debug("{}", options);
return engine.execute("rollup.js", source, options, filename);
origin: jooby-project/jooby

private V8Engine v8(String id, String scope) {
 return cache.computeIfAbsent(Thread.currentThread().getName() + ":" + id, name -> {
  V8 v8 = V8.createV8Runtime(scope);
  MemoryManager mem = new MemoryManager(v8);
  console(v8, id);
  assets(getClass(), v8);
  b64(v8);
  return new V8Engine(v8, mem, id);
 });
}
origin: org.jooby/jooby-assets-rollup

V8 v8 = engine.v8;
V8Object j2v8 = engine.hash();
j2v8.add("createFilter", engine.function((receiver, args) -> {
 List<PathMatcher> includes = filter(args, 0).stream()
   .map(it -> FileSystems.getDefault().getPathMatcher("glob:" + it))
 return engine.function((self, arguments) -> {
  Path path = Paths.get(arguments.get(0).toString());
  if (includes.stream().filter(it -> it.matches(path)).findFirst().isPresent()) {
log.debug("{}", options);
return engine.execute("rollup.js", source, options, filename);
origin: jooby-project/jooby

@SuppressWarnings("unchecked")
@Override
public String process(final String filename, final String source, final Config conf,
  final ClassLoader loader) throws Exception {
 Map<String, Object> options = new LinkedHashMap<>(options());
 Map<String, Object> predef = (Map<String, Object>) options.remove("predef");
 options.remove("excludes");
 return engine(V8Engine.class, "global")
   .execute("jshint.js", source, options(), predef, filename);
}
origin: jooby-project/jooby

@Override
public String process(final String filename, final String source, final Config conf,
  final ClassLoader loader) throws Exception {
 return engine(V8Engine.class)
   .execute("uglify.js", source, options(), filename);
}
origin: jooby-project/jooby

@Override
public String process(final String filename, final String source, final Config conf,
  final ClassLoader loader) throws Exception {
 return engine(V8Engine.class)
   .execute("auto-prefixer.js", source, options(), filename);
}
origin: jooby-project/jooby

@Override
public String process(final String filename, final String source, final Config conf,
  final ClassLoader loader) throws Exception {
 return engine(V8Engine.class)
   .execute("csslint.js", source, options(), filename);
}
origin: jooby-project/jooby

@Override
public String process(final String filename, final String source, final Config conf,
  final ClassLoader loader) throws Exception {
  return engine(V8Engine.class)
    .execute("less.js", source, options(), filename);
 }
origin: jooby-project/jooby

@Override
public String process(final String filename, final String source, final Config conf,
  final ClassLoader loader) throws Exception {
 return engine(V8Engine.class)
   .execute("babel.js", source, options(), filename);
}
origin: jooby-project/jooby

@Override
public String process(final String filename, final String source, final Config conf,
  final ClassLoader loader) throws Exception {
 return engine(V8Engine.class)
   .execute("ng-annotate.js", source, options(), filename);
}
origin: jooby-project/jooby

@Override
public String process(final String filename, final String source, final Config conf,
  final ClassLoader loader) throws Exception {
 return engine(V8Engine.class)
   .execute("clean-css.js", source, options(), filename);
}
origin: jooby-project/jooby

@Override
public String process(final String filename, final String source, final Config conf,
  final ClassLoader loader) throws Exception {
 return engine(V8Engine.class, "global")
   .execute("jscs.js", source, options(), filename);
}
org.jooby.assetsV8Engine

Most used methods

  • execute
  • hash
  • <init>
  • array
  • exists
  • function
  • get
  • load
  • problem
  • problems
  • readFile
  • register
  • readFile,
  • register,
  • releaseNow,
  • resolve

Popular in Java

  • Start an intent from android
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ImageIO (javax.imageio)
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now