public TemplateCollectionModel values() throws TemplateModelException { Object[] ids = scriptable.getIds(); Object[] values = new Object[ids.length]; for (int i = 0; i < values.length; i++) { Object id = ids[i]; if (id instanceof Number) { values[i] = ScriptableObject.getProperty(scriptable, ((Number) id).intValue()); } else { values[i] = ScriptableObject.getProperty(scriptable, String.valueOf(id)); } } return (TemplateCollectionModel) wrapper.wrap(values); }
public TemplateModel get(int index) throws TemplateModelException { Object retval = ScriptableObject.getProperty(scriptable, index); if (retval instanceof Function) { return new RhinoFunctionModel((Function) retval, scriptable, wrapper); } else { return wrapper.wrap(retval); } }
public TemplateModel get(String key) throws TemplateModelException { Object retval = ScriptableObject.getProperty(scriptable, key); if (retval instanceof Function) { return new RhinoFunctionModel((Function) retval, scriptable, wrapper); } else { return wrapper.wrap(retval); } }
public static Object getObjectIndex(Scriptable obj, int index, Context cx) { Object result = ScriptableObject.getProperty(obj, index); if (result == Scriptable.NOT_FOUND) { result = Undefined.instance; } return result; }
public static Object getObjectIndex(Scriptable obj, int index, Context cx) { Object result = ScriptableObject.getProperty(obj, index); if (result == Scriptable.NOT_FOUND) { result = Undefined.instance; } return result; }
private static Object getRawElem(Scriptable target, long index) { if (index > Integer.MAX_VALUE) { return ScriptableObject.getProperty(target, Long.toString(index)); } else { return ScriptableObject.getProperty(target, (int)index); } }
private static Object getRawElem(Scriptable target, long index) { if (index > Integer.MAX_VALUE) { return ScriptableObject.getProperty(target, Long.toString(index)); } else { return ScriptableObject.getProperty(target, (int)index); } }
private static Object topScopeName(Context cx, Scriptable scope, String name) { if (cx.useDynamicScope) { scope = checkDynamicScope(cx.topCallScope, scope); } return ScriptableObject.getProperty(scope, name); }
private static String getString(Scriptable obj, String id) { Object value = ScriptableObject.getProperty(obj, id); if (value == NOT_FOUND) return ""; return ScriptRuntime.toString(value); }
private static Object topScopeName(Context cx, Scriptable scope, String name) { if (cx.useDynamicScope) { scope = checkDynamicScope(cx.topCallScope, scope); } return ScriptableObject.getProperty(scope, name); }
private static Object topScopeName(Context cx, Scriptable scope, String name) { if (cx.useDynamicScope) { scope = checkDynamicScope(cx.topCallScope, scope); } return ScriptableObject.getProperty(scope, name); }
public static Object getObjectIndex(Scriptable obj, int index, Context cx) { if (obj instanceof XMLObject) { XMLObject xmlObject = (XMLObject)obj; return xmlObject.ecmaGet(cx, new Integer(index)); } Object result = ScriptableObject.getProperty(obj, index); if (result == Scriptable.NOT_FOUND) { result = Undefined.instance; } return result; }
public Object next() { Context.enter(); try { Object result = ScriptableObject.getProperty(scope, ids[index++].toString()); return unwrap(result); } finally { Context.exit(); } }
public static XMLLib extractFromScopeOrNull(Scriptable scope) { ScriptableObject so = ScriptRuntime.getLibraryScopeOrNull(scope); if (so == null) { // If library is not yet initialized, return null return null; } // Ensure lazily initialization of real XML library instance // which is done on first access to XML property ScriptableObject.getProperty(so, "XML"); return (XMLLib)so.getAssociatedValue(XML_LIB_KEY); }
public static XMLLib extractFromScopeOrNull(Scriptable scope) { ScriptableObject so = ScriptRuntime.getLibraryScopeOrNull(scope); if (so == null) { // If library is not yet initialized, return null return null; } // Ensure lazily initialization of real XML library instance // which is done on first access to XML property ScriptableObject.getProperty(so, "XML"); return (XMLLib)so.getAssociatedValue(XML_LIB_KEY); }
public static XMLLib extractFromScopeOrNull(Scriptable scope) { ScriptableObject so = ScriptRuntime.getLibraryScopeOrNull(scope); if (so == null) { // If library is not yet initialized, return null return null; } // Ensure lazily initialization of real XML library instance // which is done on first access to XML property ScriptableObject.getProperty(so, "XML"); return (XMLLib)so.getAssociatedValue(XML_LIB_KEY); }
public TemplateModel get(String key) throws TemplateModelException { Object retval = ScriptableObject.getProperty(scriptable, key); if (retval instanceof Function) { return new RhinoFunctionModel((Function) retval, scriptable, wrapper); } else { return wrapper.wrap(retval); } }
public static XMLLib extractFromScopeOrNull(Scriptable scope) { ScriptableObject so = ScriptRuntime.getLibraryScopeOrNull(scope); if (so == null) { // If library is not yet initialized, return null return null; } // Ensure lazily initialization of real XML library instance // which is done on first access to XML property ScriptableObject.getProperty(so, "XML"); return (XMLLib)so.getAssociatedValue(XML_LIB_KEY); }
public TemplateModel get(String key) throws TemplateModelException { Object retval = ScriptableObject.getProperty(scriptable, key); if (retval instanceof Function) { return new RhinoFunctionModel((Function) retval, scriptable, wrapper); } else { return wrapper.wrap(retval); } }
public Object getObject() { Object javaPackage; Context.enter(); try { javaPackage = ScriptableObject.getProperty( getScope(), "java" ); } finally { Context.exit(); } return javaPackage; }