當前位置: 首頁>>代碼示例>>Java>>正文


Java ELContext.setPropertyResolved方法代碼示例

本文整理匯總了Java中javax.el.ELContext.setPropertyResolved方法的典型用法代碼示例。如果您正苦於以下問題:Java ELContext.setPropertyResolved方法的具體用法?Java ELContext.setPropertyResolved怎麽用?Java ELContext.setPropertyResolved使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.el.ELContext的用法示例。


在下文中一共展示了ELContext.setPropertyResolved方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getValue

import javax.el.ELContext; //導入方法依賴的package包/類
@Override
public Object getValue(ELContext context, Object base, Object property)
        throws NullPointerException, PropertyNotFoundException, ELException {
    if (context == null) {
        throw new NullPointerException();
    }

    if (base == null) {
        context.setPropertyResolved(true);
        if (property != null) {
            try {
                return this.variableResolver.resolveVariable(property
                        .toString());
            } catch (javax.servlet.jsp.el.ELException e) {
                throw new ELException(e.getMessage(), e.getCause());
            }
        }
    }

    if (!context.isPropertyResolved()) {
        return elResolver.getValue(context, base, property);
    }
    return null;
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:25,代碼來源:ELResolverImpl.java

示例2: getValue

import javax.el.ELContext; //導入方法依賴的package包/類
@Override
public Object getValue(ELContext context, Object base, Object property)
        throws NullPointerException, PropertyNotFoundException, ELException {
    if (context == null) {
        throw new NullPointerException();
    }

    if (base == null) {
        context.setPropertyResolved(true);
        if (property != null) {
            String key = property.toString();
            PageContext page = (PageContext) context
                    .getContext(JspContext.class);
            return page.findAttribute(key);
        }
    }

    return null;
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:20,代碼來源:ScopedAttributeELResolver.java

示例3: getValue

import javax.el.ELContext; //導入方法依賴的package包/類
public Object getValue(ELContext elContext, Object base, 
                       Object property)
{
  if (base == null)
  {
    if (RequestContext.VARIABLE_NAME.equals(property))
    {
      elContext.setPropertyResolved(true);
      return RequestContext.getCurrentInstance();
    }
    // Support both "pageFlowScope" and "processScope"
    // as EL variables to give developers a time to migrate
    else if (PAGE_FLOW_SCOPE_VARIABLE_NAME.equals(property) ||
           "processScope".equals(property))
    {
      elContext.setPropertyResolved(true);
      return RequestContext.getCurrentInstance().getPageFlowScope();
    }
  }
  
  return null;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:23,代碼來源:TrinidadELResolver.java

示例4: getType

import javax.el.ELContext; //導入方法依賴的package包/類
public Class<?> getType(ELContext context, Object base, Object property)
        throws NullPointerException, PropertyNotFoundException, ELException {
    if (context == null) {
        throw new NullPointerException();
    }

    if (base == null) {
        context.setPropertyResolved(true);
        if (property != null) {
            try {
                Object obj = this.variableResolver.resolveVariable(property
                        .toString());
                return (obj != null) ? obj.getClass() : null;
            } catch (javax.servlet.jsp.el.ELException e) {
                throw new ELException(e.getMessage(), e.getCause());
            }
        }
    }

    if (!context.isPropertyResolved()) {
        return getDefaultResolver().getType(context, base, property);
    }
    return null;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:25,代碼來源:ELResolverImpl.java

示例5: getValue

import javax.el.ELContext; //導入方法依賴的package包/類
@Override
public Object getValue(ELContext elContext, Object base, Object property) throws ELException {
	if (base != null) {
		if (base instanceof WebApplicationContext) {
			WebApplicationContext wac = (WebApplicationContext) base;
			String beanName = property.toString();
			if (logger.isTraceEnabled()) {
				logger.trace("Attempting to resolve property '" + beanName + "' in root WebApplicationContext");
			}
			if (wac.containsBean(beanName)) {
				if (logger.isDebugEnabled()) {
					logger.debug("Successfully resolved property '" + beanName + "' in root WebApplicationContext");
				}
				elContext.setPropertyResolved(true);
				try {
					return wac.getBean(beanName);
				}
				catch (BeansException ex) {
					throw new ELException(ex);
				}
			}
			else {
				// Mimic standard JSF/JSP behavior when base is a Map by returning null.
				return null;
			}
		}
	}
	else {
		if (WEB_APPLICATION_CONTEXT_VARIABLE_NAME.equals(property)) {
			elContext.setPropertyResolved(true);
			return getWebApplicationContext(elContext);
		}
	}

	return null;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:37,代碼來源:WebApplicationContextFacesELResolver.java

示例6: isReadOnly

import javax.el.ELContext; //導入方法依賴的package包/類
@Override
public boolean isReadOnly(ELContext context, Object base, Object property)
        throws NullPointerException, PropertyNotFoundException, ELException {
    if (context == null) {
        throw new NullPointerException();
    }

    if (base == null) {
        context.setPropertyResolved(true);
        return true;
    }

    return elResolver.isReadOnly(context, base, property);
}
 
開發者ID:sunmingshuai,項目名稱:apache-tomcat-7.0.73-with-comment,代碼行數:15,代碼來源:ELResolverImpl.java

示例7: getType

import javax.el.ELContext; //導入方法依賴的package包/類
@Override
public Class<?> getType ( ELContext context, Object base, Object property ) {
    if ( base == null && "request".equals(property)) {
        context.setPropertyResolved(true);
        return ServletRequest.class;
    }
    return null;
}
 
開發者ID:pimps,項目名稱:ysoserial-modified,代碼行數:9,代碼來源:MyfacesTest.java

示例8: isReadOnly

import javax.el.ELContext; //導入方法依賴的package包/類
@Override
public boolean isReadOnly(ELContext context, Object base, Object property)
		throws NullPointerException, PropertyNotFoundException, ELException {
	if (context == null) {
		throw new NullPointerException();
	}

	if (base == null) {
		context.setPropertyResolved(true);
		return true;
	}

	return elResolver.isReadOnly(context, base, property);
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:15,代碼來源:ELResolverImpl.java

示例9: getValue

import javax.el.ELContext; //導入方法依賴的package包/類
public Object getValue(ELContext context, Object base, Object property)
{
  FacesContext fc = FacesContext.getCurrentInstance();
  if (base == null)
  {
    if (property != null)
    {
      Object o = _vr.resolveVariable(fc, property.toString());
      if (o != null)
      {
        context.setPropertyResolved(true);
        return o;
      }
    }
  }
  else
  {
    if (property != null)
    {
      context.setPropertyResolved(true);
      if (property instanceof Number)
        return _pr.getValue(base, ((Number) property).intValue());
      return _pr.getValue(base, property);
    }
  }

  return null;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:29,代碼來源:MockELResolver.java

示例10: invoke

import javax.el.ELContext; //導入方法依賴的package包/類
@Override
public Object invoke(ELContext context, Object base, Object method,
        Class<?>[] paramTypes, Object[] params) {
    String targetMethod = coerceToString(method);
    if (targetMethod.length() == 0) {
        throw new ELException(new NoSuchMethodException());
    }

    context.setPropertyResolved(false);

    Object result = null;

    // skip implicit and call app resolvers
    int index = 1 /* implicit */ + appResolversSize;
    for (int i = 1; i < index; i++) {
        result = resolvers[i].invoke(
                context, base, targetMethod, paramTypes, params);
        if (context.isPropertyResolved()) {
            return result;
        }
    }

    // skip map, resource, list, and array resolvers
    index += 4;
    // call bean and the rest of resolvers
    for (int i = index; i < size; i++) {
        result = resolvers[i].invoke(
                context, base, targetMethod, paramTypes, params);
        if (context.isPropertyResolved()) {
            return result;
        }
    }

    return null;
}
 
開發者ID:sunmingshuai,項目名稱:apache-tomcat-7.0.73-with-comment,代碼行數:36,代碼來源:JasperELResolver.java

示例11: getValue

import javax.el.ELContext; //導入方法依賴的package包/類
@Override
public Object getValue(ELContext context, Object base, Object property)
		throws NullPointerException, PropertyNotFoundException, ELException {
	context.setPropertyResolved(false);

	int start;
	Object result = null;

	if (base == null) {
		// call implicit and app resolvers
		int index = 1 /* implicit */ + appResolversSize;
		for (int i = 0; i < index; i++) {
			result = resolvers[i].getValue(context, base, property);
			if (context.isPropertyResolved()) {
				return result;
			}
		}
		// skip collection-based resolvers (map, resource, list, array, and
		// bean)
		start = index + 5;
	} else {
		// skip implicit resolver only
		start = 1;
	}

	for (int i = start; i < size; i++) {
		result = resolvers[i].getValue(context, base, property);
		if (context.isPropertyResolved()) {
			return result;
		}
	}

	return null;
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:35,代碼來源:JasperELResolver.java

示例12: getValue

import javax.el.ELContext; //導入方法依賴的package包/類
@Override
public Object getValue ( ELContext context, Object base, Object property ) {
    if ( base == null && "request".equals(property)) {
        context.setPropertyResolved(true);
        return this.request;
    }
    
    return null;
}
 
開發者ID:RickGray,項目名稱:ysoserial-plus,代碼行數:10,代碼來源:MyfacesTest.java

示例13: isReadOnly

import javax.el.ELContext; //導入方法依賴的package包/類
public boolean isReadOnly(ELContext context, Object base, Object property)
        throws NullPointerException, PropertyNotFoundException, ELException {
    if (context == null) {
        throw new NullPointerException();
    }

    if (base == null) {
        context.setPropertyResolved(true);
        return true;
    }

    return getDefaultResolver().isReadOnly(context, base, property);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:14,代碼來源:ELResolverImpl.java

示例14: getValue

import javax.el.ELContext; //導入方法依賴的package包/類
@Override
public Object getValue(ELContext elContext, Object base, Object property) throws ELException {
	if (base == null) {
		String beanName = property.toString();
		BeanFactory bf = getBeanFactory(elContext);
		if (bf.containsBean(beanName)) {
			if (logger.isTraceEnabled()) {
				logger.trace("Successfully resolved variable '" + beanName + "' in Spring BeanFactory");
			}
			elContext.setPropertyResolved(true);
			return bf.getBean(beanName);
		}
	}
	return null;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:16,代碼來源:SpringBeanELResolver.java

示例15: isReadOnly

import javax.el.ELContext; //導入方法依賴的package包/類
@Override
public boolean isReadOnly(ELContext context, Object base, Object property)
		throws NullPointerException, PropertyNotFoundException, ELException {
	if (context == null) {
		throw new NullPointerException();
	}

	if (base == null) {
		context.setPropertyResolved(true);
	}

	return false;
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:14,代碼來源:ScopedAttributeELResolver.java


注:本文中的javax.el.ELContext.setPropertyResolved方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。