org.mozilla.javascript.Context.toBoolean()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 JavaScript  
字(5.0k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中org.mozilla.javascript.Context.toBoolean()方法的一些代码示例,展示了Context.toBoolean()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.toBoolean()方法的具体详情如下:
包路径:org.mozilla.javascript.Context
类名称:Context
方法名:toBoolean

Context.toBoolean介绍

[英]Convert the value to a JavaScript boolean value.

See ECMA 9.2.
[中]将该值转换为JavaScript布尔值。
见ECMA 9.2。

代码示例

代码示例来源:origin: org.freemarker/freemarker

public boolean getAsBoolean() {
  return Context.toBoolean(scriptable);
}

代码示例来源:origin: apache/incubator-druid

public boolean applyInContext(Context cx, Object input)
{
 if (extractionFn != null) {
  input = extractionFn.apply(input);
 }
 return Context.toBoolean(fnApply.call(cx, scope, scope, new Object[]{input}));
}

代码示例来源:origin: pentaho/pentaho-kettle

boolean retval = Context.toBoolean( res );

代码示例来源:origin: pentaho/pentaho-kettle

overwrite = Context.toBoolean( ArgList[2] );

代码示例来源:origin: pentaho/pentaho-kettle

overwrite = Context.toBoolean( ArgList[2] );

代码示例来源:origin: org.freemarker/freemarker-gae

public boolean getAsBoolean() {
  return Context.toBoolean(scriptable);
}

代码示例来源:origin: org.freemarker/com.springsource.freemarker

public boolean getAsBoolean() {
  return Context.toBoolean(scriptable);
}

代码示例来源:origin: com.n3twork.druid/druid-processing

public boolean applyInContext(Context cx, String input)
{
 return Context.toBoolean(fnApply.call(cx, scope, scope, new String[]{input}));
}

代码示例来源:origin: io.druid/druid-processing

public boolean applyInContext(Context cx, Object input)
{
 if (extractionFn != null) {
  input = extractionFn.apply(input);
 }
 return Context.toBoolean(fnApply.call(cx, scope, scope, new Object[]{input}));
}

代码示例来源:origin: org.apache.druid/druid-processing

public boolean applyInContext(Context cx, Object input)
{
 if (extractionFn != null) {
  input = extractionFn.apply(input);
 }
 return Context.toBoolean(fnApply.call(cx, scope, scope, new Object[]{input}));
}

代码示例来源:origin: com.google.code.scriptengines/scriptengines-javascript

public boolean has(int index, Scriptable start) {
  Function func = getAdapteeFunction(HAS_PROP);
  if (func != null) {
    Object res = call(func, new Object[] { new Integer(index) });
    return Context.toBoolean(res);
  } else {
    start = getAdaptee();
    return start.has(index, start);
  }
}

代码示例来源:origin: io.apisense/rhino-android

public boolean has(int index, Scriptable start) {
  Function func = getAdapteeFunction(HAS_PROP);
  if (func != null) {
    Object res = call(func, new Object[] { new Integer(index) });
    return Context.toBoolean(res);
  } else {
    start = getAdaptee();
    return start.has(index, start);
  }
}

代码示例来源:origin: cat.inspiracio/rhino-js-engine

public boolean has(int index, Scriptable start) {
  Function func = getAdapteeFunction(HAS_PROP);
  if (func != null) {
    Object res = call(func, new Object[] { new Integer(index) });
    return Context.toBoolean(res);
  } else {
    start = getAdaptee();
    return start.has(index, start);
  }
}

代码示例来源:origin: rhq-project/rhq

@Override
public boolean has(int index, Scriptable start) {
  Function func = getAdapteeFunction(HAS_PROP);
  if (func != null) {
    Object res = call(func, new Object[] { new Integer(index) });
    return Context.toBoolean(res);
  } else {
    start = getAdaptee();
    return start.has(index, start);
  }
}

代码示例来源:origin: io.apisense/rhino-android

public boolean has(String name, Scriptable start) {
  Function func = getAdapteeFunction(HAS_PROP);
  if (func != null) {
    Object res = call(func, new Object[] { name });
    return Context.toBoolean(res);
  } else {
    start = getAdaptee();
    return start.has(name, start);
  }
}

代码示例来源:origin: cat.inspiracio/rhino-js-engine

public boolean has(String name, Scriptable start) {
  Function func = getAdapteeFunction(HAS_PROP);
  if (func != null) {
    Object res = call(func, new Object[] { name });
    return Context.toBoolean(res);
  } else {
    start = getAdaptee();
    return start.has(name, start);
  }
}

代码示例来源:origin: rhq-project/rhq

@Override
public boolean has(String name, Scriptable start) {
  Function func = getAdapteeFunction(HAS_PROP);
  if (func != null) {
    Object res = call(func, new Object[] { name });
    return Context.toBoolean(res);
  } else {
    start = getAdaptee();
    return start.has(name, start);
  }
}

代码示例来源:origin: com.google.code.scriptengines/scriptengines-javascript

public boolean has(String name, Scriptable start) {
  Function func = getAdapteeFunction(HAS_PROP);
  if (func != null) {
    Object res = call(func, new Object[] { name });
    return Context.toBoolean(res);
  } else {
    start = getAdaptee();
    return start.has(name, start);
  }
}

代码示例来源:origin: joinery/joinery-dataframe

public static Scriptable jsFunction_reindex(final Context ctx, final Scriptable object, final Object[] args, final Function func) {
  if (args.length > 0 && args[0] instanceof NativeArray) {
    if (args.length > 1) {
      return new DataFrameAdapter(object, cast(object).df.reindex(
        asList(args[0]).toArray(), Context.toBoolean(args[1])));
    }
    return new DataFrameAdapter(object, cast(object).df.reindex(asList(args[0]).toArray()));
  }
  return new DataFrameAdapter(object, cast(object).df.reindex(args));
}

代码示例来源:origin: cardillo/joinery

public static Scriptable jsFunction_reindex(final Context ctx, final Scriptable object, final Object[] args, final Function func) {
  if (args.length > 0 && args[0] instanceof NativeArray) {
    if (args.length > 1) {
      return new DataFrameAdapter(object, cast(object).df.reindex(
        asList(args[0]).toArray(), Context.toBoolean(args[1])));
    }
    return new DataFrameAdapter(object, cast(object).df.reindex(asList(args[0]).toArray()));
  }
  return new DataFrameAdapter(object, cast(object).df.reindex(args));
}

相关文章

微信公众号

Context类方法