/** * Returns the named toplevel property converted to the requested * <code>type</code> or <code>null</code> if no such property exists or the * property is of the wrong type. */ @SuppressWarnings("unchecked") private <Type> Type getProperty(Context cx, Scriptable scope, String name, Class<Type> type) { Object prop = ScriptRuntime.name(cx, scope, name); if (prop instanceof Wrapper) { prop = ((Wrapper) prop).unwrap(); } if (type.isInstance(prop)) { return (Type) prop; // unchecked case } return null; } }
continue Loop; case Token.NAME : stack[++stackTop] = ScriptRuntime.name(cx, frame.scope, stringReg); continue Loop; case Icode_NAME_INC_DEC :
continue Loop; case Token.NAME : stack[++stackTop] = ScriptRuntime.name(cx, frame.scope, stringReg); continue Loop; case Icode_NAME_INC_DEC :
private Locale getLocale() { if (locale == null) { try { // check whether we have a request object which has the locale Object reqObj = ScriptRuntime.name(Context.getCurrentContext(), this, SlingBindings.REQUEST); if (reqObj instanceof Wrapper) { Object wrapped = ((Wrapper) reqObj).unwrap(); if (wrapped instanceof HttpServletRequest) { locale = ((HttpServletRequest) wrapped).getLocale(); } } } catch (Exception e) { // ignore any exceptions resulting from this and use default } // default, if the no request locale or no request is available if (locale == null) { locale = Locale.getDefault(); } } return locale; } }
continue Loop; case Token.NAME : stack[++stackTop] = ScriptRuntime.name(cx, frame.scope, stringReg); continue Loop; case Icode_NAME_INC_DEC :
return Token.name(bytecode);
continue Loop; case Token.NAME : stack[++stackTop] = ScriptRuntime.name(cx, frame.scope, stringReg); continue Loop; case Icode_NAME_INC_DEC :
return Token.name(bytecode);
continue Loop; case Token.NAME : stack[++stackTop] = ScriptRuntime.name(cx, frame.scope, stringReg); continue Loop; case Icode_NAME_INC_DEC :
continue Loop; case Token.NAME : stack[++stackTop] = ScriptRuntime.name(cx, frame.scope, stringReg); continue Loop; case Icode_NAME_INC_DEC :