NativeArray array; array.put(array.size(), array, result);
@Override protected void defineOwnProperty(Context cx, Object id, ScriptableObject desc, boolean checkValid) { if (dense != null) { Object[] values = dense; dense = null; denseOnly = false; for (int i = 0; i < values.length; i++) { if (values[i] != NOT_FOUND) { put(i, this, values[i]); } } } long index = toArrayIndex(id); if (index >= length) { length = index + 1; } super.defineOwnProperty(cx, id, desc, checkValid); }
@Override protected void defineOwnProperty(Context cx, Object id, ScriptableObject desc, boolean checkValid) { if (dense != null) { Object[] values = dense; dense = null; denseOnly = false; for (int i = 0; i < values.length; i++) { if (values[i] != NOT_FOUND) { put(i, this, values[i]); } } } long index = toArrayIndex(id); if (index >= length) { length = index + 1; } super.defineOwnProperty(cx, id, desc, checkValid); }
@Override protected void defineOwnProperty(Context cx, Object id, ScriptableObject desc, boolean checkValid) { if (dense != null) { Object[] values = dense; dense = null; denseOnly = false; for (int i = 0; i < values.length; i++) { if (values[i] != NOT_FOUND) { put(i, this, values[i]); } } } long index = toArrayIndex(id); if (index >= length) { length = index + 1; } super.defineOwnProperty(cx, id, desc, checkValid); }
@Override protected void defineOwnProperty(Context cx, Object id, ScriptableObject desc, boolean checkValid) { if (dense != null) { Object[] values = dense; dense = null; denseOnly = false; for (int i = 0; i < values.length; i++) { if (values[i] != NOT_FOUND) { put(i, this, values[i]); } } } long index = toArrayIndex(id); if (index >= length) { length = index + 1; } super.defineOwnProperty(cx, id, desc, checkValid); }
objUrlPattern.put("httpMethod", objUrlPattern, rs.getString("HTTP_METHOD")); count++; arrUrlPatterns.put(count, arrUrlPatterns, objUrlPattern);
public NativeArray jsFunction_getChildren() throws Exception { List list = wk.getChildren(); NativeArray arr = (NativeArray)org.mozilla.javascript.Context.getCurrentContext().newObject(getParentScope(), "Array", new Object[]{new Integer(list.size())}); Iterator iter = list.iterator(); for (int i = 0; iter.hasNext(); i++) { WebContinuation child = (WebContinuation)iter.next(); FOM_WebContinuation cwk = new FOM_WebContinuation(child); cwk.setParentScope(getParentScope()); cwk.setPrototype(getClassPrototype(getParentScope(), cwk.getClassName())); arr.put(i, arr, cwk); } return arr; }
public static NativeArray getAvailableProviders() { AppManagerConfiguration config = ServiceReferenceHolder.getInstance(). getAPIManagerConfigurationService().getAPIManagerConfiguration(); List<SSOEnvironment> ssoEnvironments = config.getSsoEnvironments(); NativeArray availableProviders = new NativeArray(0); int i = 0; // boolean isAvailable = false; for(SSOEnvironment env: ssoEnvironments) { try { SSOConfigurator configurator = (SSOConfigurator) Class.forName(env.getProviderClass()).newInstance(); configurator.init(env.getParameters()); // if(configurator.isAvailable()) { // isAvailable = true; // } } catch (Exception e) { log.warn("Unable to check availability of SSO Provider " + env.toString() + " - SSO configurator will be disabled."); } // if(isAvailable) { availableProviders.put(i++, availableProviders, env.getName() + "-" + env.getVersion()); // } } return availableProviders; }
h.put((int)h.getLength(), h, source);
h.put((int)h.getLength(), h, source);