当前位置: 首页>>代码示例>>Java>>正文


Java VariableResolver.resolveVariable方法代码示例

本文整理汇总了Java中javax.faces.el.VariableResolver.resolveVariable方法的典型用法代码示例。如果您正苦于以下问题:Java VariableResolver.resolveVariable方法的具体用法?Java VariableResolver.resolveVariable怎么用?Java VariableResolver.resolveVariable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.faces.el.VariableResolver的用法示例。


在下文中一共展示了VariableResolver.resolveVariable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getValue

import javax.faces.el.VariableResolver; //导入方法依赖的package包/类
@Override
public Object getValue(FacesContext context)
{
  String varName;
  int period = _expression.indexOf('.');
  if (period < 0)
    varName = _expression;
  else
    varName = _expression.substring(0, period);

  VariableResolver vr = context.getApplication().getVariableResolver();
  Object var =  vr.resolveVariable(context, varName);
  if (period < 0)
    return var;

  return _resolveProperty(context, var, _expression.substring(period + 1));
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:18,代码来源:MValueBinding.java

示例2: getInstance

import javax.faces.el.VariableResolver; //导入方法依赖的package包/类
public Object getInstance() throws InstantiationException
{
    FacesContext facesContext = FacesContext.getCurrentInstance();
    if (facesContext == null)
    {
        log.error("Object " + getManagedBeanName() + " cannot be created since the faces context is null");
        return null;
    }

    Application application = facesContext.getApplication();
    Object resolvedObject = null;

    if (isVBExpression(getManagedBeanName()))
    {
        ValueBinding vb = application.createValueBinding(getManagedBeanName());
        if (vb != null)
        {
            resolvedObject = vb.getValue(facesContext);
        }
    }
    else
    {
        VariableResolver resolver = application.getVariableResolver();
        resolvedObject = resolver.resolveVariable(facesContext, getManagedBeanName());
    }

    return resolvedObject;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:29,代码来源:JsfCreator.java

示例3: getInstance

import javax.faces.el.VariableResolver; //导入方法依赖的package包/类
@Override
public Object getInstance() throws InstantiationException
{
    FacesContext facesContext = FacesContext.getCurrentInstance();
    if (facesContext == null)
    {
        log.error("Object " + getManagedBeanName() + " cannot be created since the faces context is null");
        return null;
    }

    Application application = facesContext.getApplication();
    Object resolvedObject = null;

    if (isVBExpression(getManagedBeanName()))
    {
        ValueBinding vb = application.createValueBinding(getManagedBeanName());
        if (vb != null)
        {
            resolvedObject = vb.getValue(facesContext);
        }
    }
    else
    {
        VariableResolver resolver = application.getVariableResolver();
        resolvedObject = resolver.resolveVariable(facesContext, getManagedBeanName());
    }

    return resolvedObject;
}
 
开发者ID:directwebremoting,项目名称:dwr,代码行数:30,代码来源:JsfCreator.java

示例4: resolveManagedBean

import javax.faces.el.VariableResolver; //导入方法依赖的package包/类
/**
 * Resolves a managed bean variable.
 * @param managedBeanName the configured name of the managed bean
 * @return the located object (can be null)
 */
public Object resolveManagedBean(String managedBeanName) {
  Object oBean = null;
  String sn = Val.chkStr(managedBeanName);
  FacesContext fc = getFacesContext();
  if ((sn.length() > 0) && (fc != null) && (fc.getApplication() != null)) {
    VariableResolver resolver = fc.getApplication().getVariableResolver();
    if (resolver != null) {
      oBean = resolver.resolveVariable(fc,sn);
    }
  }
  return oBean;
}
 
开发者ID:GeoinformationSystems,项目名称:GeoprocessingAppstore,代码行数:18,代码来源:FacesContextBroker.java

示例5: getCurrentInstance

import javax.faces.el.VariableResolver; //导入方法依赖的package包/类
/**
 * Gets current instance of the controller.
 * @return current instance of the controller
 */
public static LiveDataController getCurrentInstance() {
  FacesContext fc = FacesContext.getCurrentInstance();
  VariableResolver vr = fc.getApplication().getVariableResolver();
  return (LiveDataController) vr.resolveVariable(fc, "LiveDataController");
}
 
开发者ID:GeoinformationSystems,项目名称:GeoprocessingAppstore,代码行数:10,代码来源:LiveDataController.java

示例6: getPage

import javax.faces.el.VariableResolver; //导入方法依赖的package包/类
/**
 * ページオブジェクトを返す.
 * @param pageName
 *            ページオブジェクト名
 * @return ページオブジェクト
 */
public Page getPage(String pageName) {
    VariableResolver resolver = context.getApplication().getVariableResolver();
    return (Page) resolver.resolveVariable(context, pageName);
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:11,代码来源:FacesHelper.java


注:本文中的javax.faces.el.VariableResolver.resolveVariable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。