当前位置: 首页>>代码示例>>Java>>正文


Java V8Array.release方法代码示例

本文整理汇总了Java中com.eclipsesource.v8.V8Array.release方法的典型用法代码示例。如果您正苦于以下问题:Java V8Array.release方法的具体用法?Java V8Array.release怎么用?Java V8Array.release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.eclipsesource.v8.V8Array的用法示例。


在下文中一共展示了V8Array.release方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import com.eclipsesource.v8.V8Array; //导入方法依赖的package包/类
@Override
public String execute(String dot) {
	V8Array parameters = new V8Array(runtime).push(dot);
	try {
		runtime.executeVoidScript(JSMESSAGESARRAYSPLICE);
		return (String) vizFunction.call(runtime, parameters);
	} catch (Exception e) {

		if (messages.length() > 0) {
			// Now something really bad happened: viz.js tells us something
			// with printing (e.g. Abort).
			String summary = "";
			for (int i = 0; i < messages.length(); i++) {
				summary += V8ObjectUtils.getValue(messages, i) + "\n";
			}
			throw new VizJSException(summary, e);
		}

		throw new VizJSException("Problems executing function viz.js in engine: " + getVersion(), e);
	} finally {
		parameters.release();
	}
}
 
开发者ID:plantuml,项目名称:vizjs,代码行数:24,代码来源:V8VizJS.java

示例2: jcdemoString

import com.eclipsesource.v8.V8Array; //导入方法依赖的package包/类
private void jcdemoString(V8Array parameters) {
    String[] calls = JCDemoString.splitBy(parameters.getString(0), parameters.getInteger(1), '&');
    parameters.release();
    for (String call: calls) {
        jsdemoString.call(call);
    }
    justView.draw(jsdemoString.getShapeList());
    jsdemoString.clearShapeList();
}
 
开发者ID:LiuHongtao,项目名称:JustDraw,代码行数:10,代码来源:JCDemoActivity.java

示例3: jcdemoJson

import com.eclipsesource.v8.V8Array; //导入方法依赖的package包/类
private void jcdemoJson(V8Array parameters) {
    JustCall[] calls = JSON.parseObject(parameters.getString(0), JustCall[].class);
    parameters.release();
    for (JustCall call: calls) {
        jsdemoJson.call(call);
    }
    justView.draw(jsdemoJson.getShapeList());
    jsdemoJson.clearShapeList();
}
 
开发者ID:LiuHongtao,项目名称:JustDraw,代码行数:10,代码来源:JCDemoActivity.java

示例4: setLineDash

import com.eclipsesource.v8.V8Array; //导入方法依赖的package包/类
public void setLineDash(V8Array intervals) {
    float[] floatIntervals = new float[intervals.length()];
    for (int i = 0; i < intervals.length(); i++) {
        floatIntervals[i] = (float)((double)intervals.getDouble(i));
    }

    PathEffect effects = new DashPathEffect(floatIntervals, 1);
    mPaintStroke.setPathEffect(effects);

    intervals.release();
}
 
开发者ID:LiuHongtao,项目名称:JustDraw,代码行数:12,代码来源:JustContext.java

示例5: getSanitizedHtml

import com.eclipsesource.v8.V8Array; //导入方法依赖的package包/类
/**
	 * Parses the supplied markdown into html.
	 * This calls the PageDown javascript library to do the work for us.
	 */
	public static String getSanitizedHtml(String markdown){
		
//		System.out.println(new File(".").getAbsolutePath());
//		for(String f : new File(".").list()){
//			System.out.println("\t" + f);
//		}

		if(markdown == null){
			return null;
		}

		try{
			V8 runtime = V8.createV8Runtime();
			
			 runtime.executeScript( new String(Files.readAllBytes(Paths.get(PageDownUtils.class.getResource("Markdown.Converter.js").toURI()))));
	         runtime.executeScript( new String(Files.readAllBytes(Paths.get(PageDownUtils.class.getResource("Markdown.Sanitizer.js").toURI()))));
	         runtime.executeScript( new String(Files.readAllBytes(Paths.get(PageDownUtils.class.getResource("MarkdownParser.js").toURI()))));

			V8Array args = new V8Array(runtime);
			args.push(markdown);

			String html = runtime.executeStringFunction("parseMarkdown", args);
			args.release();
			runtime.release();
			return html;
		}
		catch(Exception e){
			e.printStackTrace();
			return "ERROR";
		}
	}
 
开发者ID:KevinWorkman,项目名称:StaticVoidGames,代码行数:36,代码来源:PageDownUtils.java

示例6: convert

import com.eclipsesource.v8.V8Array; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <T> T convert(Object r, Class<T> resultType) {
	if (List.class.isAssignableFrom(resultType) && r instanceof V8Array) {
		V8Array arr = (V8Array)r;
		r = convertArray(arr);
		arr.release();
	} else if (Map.class.isAssignableFrom(resultType) && r instanceof V8Object) {
		V8Object obj = (V8Object)r;
		r = convertObject(obj);
		obj.release();
	}
	return (T)r;
}
 
开发者ID:michel-kraemer,项目名称:citeproc-java,代码行数:15,代码来源:V8ScriptRunner.java


注:本文中的com.eclipsesource.v8.V8Array.release方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。