⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interpretresolver.java

📁 ZK 基础介绍 功能操作 模块 结合数据库操作
💻 JAVA
字号:
/* InterpretResolver.java{{IS_NOTE	Purpose:			Description:			History:		Sat Sep 17 17:03:58     2005, Created by tomyeh}}IS_NOTECopyright (C) 2004 Potix Corporation. All Rights Reserved.{{IS_RIGHT	This program is distributed under GPL Version 2.0 in the hope that	it will be useful, but WITHOUT ANY WARRANTY.}}IS_RIGHT*/package org.zkoss.web.servlet.dsp.impl;import java.util.Map;import java.util.HashMap;import java.util.Collections;import org.zkoss.lang.D;import org.zkoss.xel.VariableResolver;import org.zkoss.xel.XelException;import org.zkoss.web.servlet.dsp.*;import org.zkoss.web.servlet.dsp.action.ActionContext;/** * The resolver used to interpret an {@link Interpretation}. * * @author tomyeh */class InterpretResolver implements VariableResolver {	private final VariableResolver _parent;	private final Map _attrs = new HashMap();	InterpretResolver(VariableResolver parent) {		assert D.OFF || !(parent instanceof InterpretResolver);		_parent = parent;	}	/** Returns the attributes of the given scope. */	Map getAttributes(int scope) throws XelException {		if (scope == ActionContext.PAGE_SCOPE)			return _attrs;		Map attrs = null;		if (_parent != null) {			switch (scope) {			case ActionContext.REQUEST_SCOPE:				attrs = (Map)_parent.resolveVariable("requestScope");				break;			case ActionContext.SESSION_SCOPE:				attrs = (Map)_parent.resolveVariable("sessionScope");				break;			case ActionContext.APPLICATION_SCOPE:				attrs = (Map)_parent.resolveVariable("applicationScope");				break;			}		}		return attrs != null ? attrs: Collections.EMPTY_MAP;	}	//-- VariableResolver --//	public Object resolveVariable(String name) throws XelException {		if ("pageScope".equals(name))			return _attrs;		final Object o = _attrs.get(name);		if (o != null) return o;		return _parent != null ? _parent.resolveVariable(name): null;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -