本文整理了Java中org.mozilla.javascript.xml.XMLObject.ecmaPut()
方法的一些代码示例,展示了XMLObject.ecmaPut()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLObject.ecmaPut()
方法的具体详情如下:
包路径:org.mozilla.javascript.xml.XMLObject
类名称:XMLObject
方法名:ecmaPut
[英]Implementation of ECMAScript Put.
[中]ECMAScriptPut的实现。
代码示例来源:origin: rhino/js
public static Object setObjectIndex(Scriptable obj, int index, Object value,
Context cx)
{
if (obj instanceof XMLObject) {
XMLObject xmlObject = (XMLObject)obj;
xmlObject.ecmaPut(cx, new Integer(index), value);
} else {
ScriptableObject.putProperty(obj, index, value);
}
return value;
}
代码示例来源:origin: com.sun.phobos/phobos-rhino
public static Object setObjectIndex(Scriptable obj, int index, Object value,
Context cx)
{
if (obj instanceof XMLObject) {
XMLObject xmlObject = (XMLObject)obj;
xmlObject.ecmaPut(cx, new Integer(index), value);
} else {
ScriptableObject.putProperty(obj, index, value);
}
return value;
}
代码示例来源:origin: com.sun.phobos/phobos-rhino
public static Object setObjectProp(Scriptable obj, String property,
Object value, Context cx)
{
if (obj instanceof XMLObject) {
XMLObject xmlObject = (XMLObject)obj;
xmlObject.ecmaPut(cx, property, value);
} else {
ScriptableObject.putProperty(obj, property, value);
}
return value;
}
代码示例来源:origin: com.sun.phobos/phobos-rhino
public static Object setConst(Scriptable bound, Object value,
Context cx, String id)
{
if (bound instanceof XMLObject) {
XMLObject xmlObject = (XMLObject)bound;
xmlObject.ecmaPut(cx, id, value);
} else {
ScriptableObject.putConstProperty(bound, id, value);
}
return value;
}
代码示例来源:origin: rhino/js
public static Object setObjectProp(Scriptable obj, String property,
Object value, Context cx)
{
if (obj instanceof XMLObject) {
XMLObject xmlObject = (XMLObject)obj;
xmlObject.ecmaPut(cx, property, value);
} else {
ScriptableObject.putProperty(obj, property, value);
}
return value;
}
代码示例来源:origin: rhino/js
public static Object setConst(Scriptable bound, Object value,
Context cx, String id)
{
if (bound instanceof XMLObject) {
XMLObject xmlObject = (XMLObject)bound;
xmlObject.ecmaPut(cx, id, value);
} else {
ScriptableObject.putConstProperty(bound, id, value);
}
return value;
}
代码示例来源:origin: rhino/js
public static Object setObjectElem(Scriptable obj, Object elem,
Object value, Context cx)
{
if (obj instanceof XMLObject) {
XMLObject xmlObject = (XMLObject)obj;
xmlObject.ecmaPut(cx, elem, value);
return value;
}
String s = toStringIdOrIndex(cx, elem);
if (s == null) {
int index = lastIndexResult(cx);
ScriptableObject.putProperty(obj, index, value);
} else {
ScriptableObject.putProperty(obj, s, value);
}
return value;
}
代码示例来源:origin: com.sun.phobos/phobos-rhino
public static Object setObjectElem(Scriptable obj, Object elem,
Object value, Context cx)
{
if (obj instanceof XMLObject) {
XMLObject xmlObject = (XMLObject)obj;
xmlObject.ecmaPut(cx, elem, value);
return value;
}
String s = toStringIdOrIndex(cx, elem);
if (s == null) {
int index = lastIndexResult(cx);
ScriptableObject.putProperty(obj, index, value);
} else {
ScriptableObject.putProperty(obj, s, value);
}
return value;
}
代码示例来源:origin: rhino/js
public static Object setName(Scriptable bound, Object value,
Context cx, Scriptable scope, String id)
{
if (bound != null) {
if (bound instanceof XMLObject) {
XMLObject xmlObject = (XMLObject)bound;
xmlObject.ecmaPut(cx, id, value);
} else {
ScriptableObject.putProperty(bound, id, value);
}
} else {
// "newname = 7;", where 'newname' has not yet
// been defined, creates a new property in the
// top scope unless strict mode is specified.
if (cx.hasFeature(Context.FEATURE_STRICT_MODE) ||
cx.hasFeature(Context.FEATURE_STRICT_VARS))
{
Context.reportWarning(
ScriptRuntime.getMessage1("msg.assn.create.strict", id));
}
// Find the top scope by walking up the scope chain.
bound = ScriptableObject.getTopLevelScope(scope);
if (cx.useDynamicScope) {
bound = checkDynamicScope(cx.topCallScope, bound);
}
bound.put(id, bound, value);
}
return value;
}
代码示例来源:origin: com.sun.phobos/phobos-rhino
public static Object setName(Scriptable bound, Object value,
Context cx, Scriptable scope, String id)
{
if (bound != null) {
if (bound instanceof XMLObject) {
XMLObject xmlObject = (XMLObject)bound;
xmlObject.ecmaPut(cx, id, value);
} else {
ScriptableObject.putProperty(bound, id, value);
}
} else {
// "newname = 7;", where 'newname' has not yet
// been defined, creates a new property in the
// top scope unless strict mode is specified.
if (cx.hasFeature(Context.FEATURE_STRICT_MODE) ||
cx.hasFeature(Context.FEATURE_STRICT_VARS))
{
Context.reportWarning(
ScriptRuntime.getMessage1("msg.assn.create.strict", id));
}
// Find the top scope by walking up the scope chain.
bound = ScriptableObject.getTopLevelScope(scope);
if (cx.useDynamicScope) {
bound = checkDynamicScope(cx.topCallScope, bound);
}
bound.put(id, bound, value);
}
return value;
}
内容来源于网络,如有侵权,请联系作者删除!