本文整理了Java中org.mozilla.javascript.WrapFactory.wrap()
方法的一些代码示例,展示了WrapFactory.wrap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WrapFactory.wrap()
方法的具体详情如下:
包路径:org.mozilla.javascript.WrapFactory
类名称:WrapFactory
方法名:wrap
[英]Wrap the object.
The value returned must be one of
代码示例来源:origin: rhq-project/rhq
/**
* This behaves exactly the same as the super class' method except the fact that
* the ConsString is considered "primitive" and is not wrapped in any manner.
* <p>
* This is then consistent with the rest of Rhino that expects ConsString as a possible
* implementation of the string.
*/
@Override
public Object wrap(Context cx, Scriptable scope, Object obj, Class<?> staticType) {
if (obj instanceof ConsString) {
return obj;
}
return super.wrap(cx, scope, obj, staticType);
}
}
代码示例来源:origin: RPTools/maptool
@SuppressWarnings("rawtypes")
@Override
public Object wrap(Context cx, Scriptable scope, Object obj, Class staticType) {
if (obj instanceof String || obj instanceof Number || obj instanceof Boolean) {
return obj;
} else if (obj instanceof Character) {
char[] a = { ((Character) obj).charValue() };
return new String(a);
}
return super.wrap(cx, scope, obj, staticType);
}
}
代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik
public Object wrap(Context ctx, Scriptable scope,
Object obj, Class staticType) {
if (obj instanceof EventTarget) {
return interpreter.buildEventTargetWrapper((EventTarget)obj);
}
return super.wrap(ctx, scope, obj, staticType);
}
}
代码示例来源:origin: org.apache.xmlgraphics/batik-bridge
public Object wrap(Context ctx, Scriptable scope,
Object obj, Class staticType) {
if (obj instanceof EventTarget) {
return interpreter.buildEventTargetWrapper((EventTarget)obj);
}
return super.wrap(ctx, scope, obj, staticType);
}
}
代码示例来源:origin: apache/batik
public Object wrap(Context ctx, Scriptable scope,
Object obj, Class staticType) {
if (obj instanceof EventTarget) {
return interpreter.buildEventTargetWrapper((EventTarget)obj);
}
return super.wrap(ctx, scope, obj, staticType);
}
}
代码示例来源:origin: rhino/js
@Override
public Object get(int index, Scriptable start) {
if (0 <= index && index < length) {
Context cx = Context.getContext();
Object obj = Array.get(array, index);
return cx.getWrapFactory().wrap(cx, this, obj, cls);
}
return Undefined.instance;
}
代码示例来源:origin: geogebra/geogebra
/**
* @deprecated Use {@link Context#getWrapFactory()} together with calling {@link
* WrapFactory#wrap(Context, Scriptable, Object, Class)}
*/
@Deprecated
public static Object wrap(Scriptable scope, Object obj, Class<?> staticType) {
Context cx = Context.getContext();
return cx.getWrapFactory().wrap(cx, scope, obj, staticType);
}
代码示例来源:origin: com.sun.phobos/phobos-rhino
public Object get(int index, Scriptable start) {
if (0 <= index && index < length) {
Context cx = Context.getContext();
Object obj = Array.get(array, index);
return cx.getWrapFactory().wrap(cx, this, obj, cls);
}
return Undefined.instance;
}
代码示例来源:origin: com.github.tntim96/rhino
@Override
public Object get(int index, Scriptable start) {
if (0 <= index && index < length) {
Context cx = Context.getContext();
Object obj = Array.get(array, index);
return cx.getWrapFactory().wrap(cx, this, obj, cls);
}
return Undefined.instance;
}
代码示例来源:origin: geogebra/geogebra
@Override
public Object get(int index, Scriptable start) {
if (0 <= index && index < length) {
Context cx = Context.getContext();
Object obj = Array.get(array, index);
return cx.getWrapFactory().wrap(cx, this, obj, cls);
}
return Undefined.instance;
}
代码示例来源:origin: io.apigee/rhino
@Override
public Object get(int index, Scriptable start) {
if (0 <= index && index < length) {
Context cx = Context.getContext();
Object obj = Array.get(array, index);
return cx.getWrapFactory().wrap(cx, this, obj, cls);
}
return Undefined.instance;
}
代码示例来源:origin: ro.isdc.wro4j/rhino
@Override
public Object get(int index, Scriptable start) {
if (0 <= index && index < length) {
Context cx = Context.getContext();
Object obj = Array.get(array, index);
return cx.getWrapFactory().wrap(cx, this, obj, cls);
}
return Undefined.instance;
}
代码示例来源:origin: rhino/js
/**
@deprecated Use {@link Context#getWrapFactory()} together with calling {@link
WrapFactory#wrap(Context, Scriptable, Object, Class)}
*/
public static Object wrap(Scriptable scope, Object obj, Class<?> staticType) {
Context cx = Context.getContext();
return cx.getWrapFactory().wrap(cx, scope, obj, staticType);
}
代码示例来源:origin: io.apigee/rhino
/**
@deprecated Use {@link Context#getWrapFactory()} together with calling {@link
WrapFactory#wrap(Context, Scriptable, Object, Class)}
*/
public static Object wrap(Scriptable scope, Object obj, Class<?> staticType) {
Context cx = Context.getContext();
return cx.getWrapFactory().wrap(cx, scope, obj, staticType);
}
代码示例来源:origin: ro.isdc.wro4j/rhino
/**
@deprecated Use {@link Context#getWrapFactory()} together with calling {@link
WrapFactory#wrap(Context, Scriptable, Object, Class)}
*/
public static Object wrap(Scriptable scope, Object obj, Class<?> staticType) {
Context cx = Context.getContext();
return cx.getWrapFactory().wrap(cx, scope, obj, staticType);
}
代码示例来源:origin: com.sun.phobos/phobos-rhino
/**
@deprecated Use {@link Context#getWrapFactory()} together with calling {@link
WrapFactory#wrap(Context cx, Scriptable scope, Object obj, Class)}
*/
public static Object wrap(Scriptable scope, Object obj, Class staticType) {
Context cx = Context.getContext();
return cx.getWrapFactory().wrap(cx, scope, obj, staticType);
}
代码示例来源:origin: com.github.tntim96/rhino
/**
@deprecated Use {@link Context#getWrapFactory()} together with calling {@link
WrapFactory#wrap(Context, Scriptable, Object, Class)}
*/
public static Object wrap(Scriptable scope, Object obj, Class<?> staticType) {
Context cx = Context.getContext();
return cx.getWrapFactory().wrap(cx, scope, obj, staticType);
}
代码示例来源:origin: rhino/js
private static Object doCall(Context cx, Scriptable scope,
Scriptable thisObj, Function f,
Object[] args, long argsToWrap)
{
// Wrap the rest of objects
for (int i = 0; i != args.length; ++i) {
if (0 != (argsToWrap & (1 << i))) {
Object arg = args[i];
if (!(arg instanceof Scriptable)) {
args[i] = cx.getWrapFactory().wrap(cx, scope, arg,
null);
}
}
}
return f.call(cx, scope, thisObj, args);
}
代码示例来源:origin: geogebra/geogebra
private static Object doCall(Context cx, Scriptable scope,
Scriptable thisObj, Function f,
Object[] args, long argsToWrap)
{
// Wrap the rest of objects
for (int i = 0; i != args.length; ++i) {
if (0 != (argsToWrap & (1 << i))) {
Object arg = args[i];
if (!(arg instanceof Scriptable)) {
args[i] = cx.getWrapFactory().wrap(cx, scope, arg,
null);
}
}
}
return f.call(cx, scope, thisObj, args);
}
代码示例来源:origin: io.apigee/rhino
private static Object doCall(Context cx, Scriptable scope,
Scriptable thisObj, Function f,
Object[] args, long argsToWrap)
{
// Wrap the rest of objects
for (int i = 0; i != args.length; ++i) {
if (0 != (argsToWrap & (1 << i))) {
Object arg = args[i];
if (!(arg instanceof Scriptable)) {
args[i] = cx.getWrapFactory().wrap(cx, scope, arg,
null);
}
}
}
return f.call(cx, scope, thisObj, args);
}
内容来源于网络,如有侵权,请联系作者删除!