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


Java ELResolver.getValue方法代碼示例

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


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

示例1: getValue

import javax.el.ELResolver; //導入方法依賴的package包/類
public Object getValue(EvaluationContext ctx) throws ELException {
    Object base = this.children[0].getValue(ctx);
    int propCount = this.jjtGetNumChildren();
    int i = 1;
    Object property = null;
    ELResolver resolver = ctx.getELResolver();
    while (base != null && i < propCount) {
        property = this.children[i].getValue(ctx);
        if (property == null) {
            return null;
        } else {
            ctx.setPropertyResolved(false);
            base = resolver.getValue(ctx, base, property);
        }
        i++;
    }
    return base;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:19,代碼來源:AstValue.java

示例2: getValue

import javax.el.ELResolver; //導入方法依賴的package包/類
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
    Object base = this.children[0].getValue(ctx);
    int propCount = this.jjtGetNumChildren();
    int i = 1;
    Object suffix = null;
    ELResolver resolver = ctx.getELResolver();
    while (base != null && i < propCount) {
        suffix = this.children[i].getValue(ctx);
        if (i + 1 < propCount &&
                (this.children[i+1] instanceof AstMethodParameters)) {
            AstMethodParameters mps =
                (AstMethodParameters) this.children[i+1];
            // This is a method
            Object[] paramValues = mps.getParameters(ctx);
            base = resolver.invoke(ctx, base, suffix,
                    getTypesFromValues(paramValues), paramValues);
            i+=2;
        } else {
            // This is a property
            if (suffix == null) {
                return null;
            }
            
            ctx.setPropertyResolved(false);
            base = resolver.getValue(ctx, base, suffix);
            i++;
        }
    }
    if (!ctx.isPropertyResolved()) {
        throw new PropertyNotFoundException(MessageFactory.get(
                "error.resolver.unhandled", base, suffix));            
    }
    return base;
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:36,代碼來源:AstValue.java

示例3: evaluateProperty

import javax.el.ELResolver; //導入方法依賴的package包/類
private Object evaluateProperty(ELResolver resolver, ELContext context, Object base, String property)
{
  //simple property -> resolve value directly
  if (!property.contains( "." ))
    return resolver.getValue(context, base, property );

  int index = property.indexOf( '.' );
  Object newBase = resolver.getValue(context, base, property.substring( 0, index ) );

  return evaluateProperty(resolver, context, newBase, property.substring( index + 1 ) );
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:12,代碼來源:SortableModel.java

示例4: __resolveProperty

import javax.el.ELResolver; //導入方法依賴的package包/類
static Object __resolveProperty(Object object, String propertyName)
{
  FacesContext context = FacesContext.getCurrentInstance();
  ELResolver resolver = _getELResolver(context);
  ELContext elContext = _getELContext(context, resolver);
  return resolver.getValue(elContext, object, propertyName);
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:8,代碼來源:SortableModel.java

示例5: getValue

import javax.el.ELResolver; //導入方法依賴的package包/類
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
	Object base = this.children[0].getValue(ctx);
	int propCount = this.jjtGetNumChildren();
	int i = 1;
	Object suffix = null;
	ELResolver resolver = ctx.getELResolver();
	while (base != null && i < propCount) {
		suffix = this.children[i].getValue(ctx);
		if (i + 1 < propCount && (this.children[i + 1] instanceof AstMethodParameters)) {
			AstMethodParameters mps = (AstMethodParameters) this.children[i + 1];
			// This is a method
			Object[] paramValues = mps.getParameters(ctx);
			base = resolver.invoke(ctx, base, suffix, getTypesFromValues(paramValues), paramValues);
			i += 2;
		} else {
			// This is a property
			if (suffix == null) {
				return null;
			}

			ctx.setPropertyResolved(false);
			base = resolver.getValue(ctx, base, suffix);
			i++;
		}
	}
	if (!ctx.isPropertyResolved()) {
		throw new PropertyNotFoundException(MessageFactory.get("error.resolver.unhandled", base, suffix));
	}
	return base;
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:32,代碼來源:AstValue.java

示例6: resolveVariable

import javax.el.ELResolver; //導入方法依賴的package包/類
/**
 * Resolves the specified variable within the given context.
 * Returns null if the variable is not found.
 **/
public Object resolveVariable (String pName)
        throws javax.servlet.jsp.el.ELException {

    ELContext elContext = pageContext.getELContext();
    ELResolver elResolver = elContext.getELResolver();
    try {
        return elResolver.getValue(elContext, null, pName);
    } catch (javax.el.ELException ex) {
        throw new javax.servlet.jsp.el.ELException();
    }
}
 
開發者ID:eclipse,項目名稱:packagedrone,代碼行數:16,代碼來源:VariableResolverImpl.java

示例7: getSession

import javax.el.ELResolver; //導入方法依賴的package包/類
protected SessionAbstractBean getSession(){
	if(session == null){
		FacesContext fc = getFacesContext(); 
		ELResolver resolver = fc.getApplication().getELResolver();
		session = (SessionAbstractBean) resolver.getValue(fc.getELContext(), null, sessionBeanName);
	}

	return session;
}
 
開發者ID:malaguna,項目名稱:cmdit,代碼行數:10,代碼來源:RequestAbstractBean.java

示例8: reset

import javax.el.ELResolver; //導入方法依賴的package包/類
public void reset(ActionEvent event) {
	this.showResult = false;
	this.queryResults = new ArrayList<String>();
	
	FacesContext fc = FacesContext.getCurrentInstance();
       ELResolver el = fc.getApplication().getELResolver();
       ELContext elc = fc.getELContext();
       MetFragBean mfb = (MetFragBean) el.getValue(elc, null, "metFragBean");
       mfb.reset(null);
}
 
開發者ID:mgerlich,項目名稱:MetFusion,代碼行數:11,代碼來源:MassBankLookupBean.java

示例9: getTarget

import javax.el.ELResolver; //導入方法依賴的package包/類
public Object getTarget(Object base, EvaluationContext ctx)
		throws ELException {
	if (base == null) return null;
	ELResolver resolver = ctx.getELResolver();
	ctx.setPropertyResolved(false);
	Object r = resolver.getValue(ctx, base, this.image);
	if (r == null) {
		throw new PropertyNotFoundException(MessageFactory.get(
				"error.unreachable.property", base.getClass().getName(),
				this.image));
	}
	return r;
}
 
開發者ID:seam2,項目名稱:jboss-el,代碼行數:14,代碼來源:AstPropertySuffix.java

示例10: getValue

import javax.el.ELResolver; //導入方法依賴的package包/類
public Object getValue(Object base, EvaluationContext ctx)
		throws ELException {
	if (base == null)
		return null;
	ELResolver resolver = ctx.getELResolver();
	ctx.setPropertyResolved(false);
	return resolver.getValue(ctx, base, this.image);
}
 
開發者ID:seam2,項目名稱:jboss-el,代碼行數:9,代碼來源:AstPropertySuffix.java

示例11: getTarget

import javax.el.ELResolver; //導入方法依賴的package包/類
public Object getTarget(Object base, EvaluationContext ctx) throws ELException {
	if (base == null) return null;
	
	ELResolver resolver = ctx.getELResolver();
	ctx.setPropertyResolved(false);
	Object p = this.getValue(ctx);
	Object r = resolver.getValue(ctx, base, p);
	if (r == null) {
		throw new PropertyNotFoundException(MessageFactory.get(
				"error.unreachable.property", base.getClass().getName(),
				p));
	}
	return r;
}
 
開發者ID:seam2,項目名稱:jboss-el,代碼行數:15,代碼來源:AstBracketSuffix.java

示例12: getValue

import javax.el.ELResolver; //導入方法依賴的package包/類
public Object getValue(Object base, EvaluationContext ctx) throws ELException {
	if (base == null) return null;
	
	ELResolver resolver = ctx.getELResolver();
	ctx.setPropertyResolved(false);
	return resolver.getValue(ctx, base, this.getValue(ctx));
}
 
開發者ID:seam2,項目名稱:jboss-el,代碼行數:8,代碼來源:AstBracketSuffix.java

示例13: getValue

import javax.el.ELResolver; //導入方法依賴的package包/類
@Override
public Object getValue(EvaluationContext ctx) throws ELException {
    Object base = this.children[0].getValue(ctx);
    int propCount = this.jjtGetNumChildren();
    int i = 1;
    Object suffix = null;
    ELResolver resolver = ctx.getELResolver();
    while (base != null && i < propCount) {
        suffix = this.children[i].getValue(ctx);
        if (i + 1 < propCount &&
                (this.children[i+1] instanceof AstMethodParameters)) {
            AstMethodParameters mps =
                (AstMethodParameters) this.children[i+1];
            // This is a method
            base = resolver.invoke(ctx, base, suffix, null,
                    mps.getParameters(ctx));
            i+=2;
        } else {
            // This is a property
            if (suffix == null) {
                return null;
            }
            
            ctx.setPropertyResolved(false);
            base = resolver.getValue(ctx, base, suffix);
            i++;
        }
    }
    if (!ctx.isPropertyResolved()) {
        throw new PropertyNotFoundException(MessageFactory.get(
                "error.resolver.unhandled", base, suffix));            
    }
    return base;
}
 
開發者ID:WhiteBearSolutions,項目名稱:WBSAirback,代碼行數:35,代碼來源:AstValue.java

示例14: getTarget

import javax.el.ELResolver; //導入方法依賴的package包/類
private final Target getTarget(EvaluationContext ctx) throws ELException {
    // evaluate expr-a to value-a
    Object base = this.children[0].getValue(ctx);

    // if our base is null (we know there are more properties to evaluate)
    if (base == null) {
        throw new PropertyNotFoundException(MessageFactory.get(
                "error.unreachable.base", this.children[0].getImage()));
    }

    // set up our start/end
    Object property = null;
    int propCount = this.jjtGetNumChildren();
    
    int i = 1;
    // Evaluate any properties or methods before our target
    ELResolver resolver = ctx.getELResolver();
    while (i < propCount) {
        if (i + 2 < propCount &&
                this.children[i + 1] instanceof AstMethodParameters) {
            // Method call not at end of expression
            base = resolver.invoke(ctx, base,
                    this.children[i].getValue(ctx), null,
                    ((AstMethodParameters)
                            this.children[i + 1]).getParameters(ctx));
            i += 2;
        } else if (i + 2 == propCount &&
                this.children[i + 1] instanceof AstMethodParameters) {
            // Method call at end of expression
            ctx.setPropertyResolved(false);
            property = this.children[i].getValue(ctx);
            i += 2;

            if (property == null) {
                throw new PropertyNotFoundException(MessageFactory.get(
                        "error.unreachable.property", property));
            }
        } else if (i + 1 < propCount) {
            // Object with property not at end of expression
            property = this.children[i].getValue(ctx);
            ctx.setPropertyResolved(false);
            base = resolver.getValue(ctx, base, property);
            i++;

        } else {
            // Object with property at end of expression
            ctx.setPropertyResolved(false);
            property = this.children[i].getValue(ctx);
            i++;

            if (property == null) {
                throw new PropertyNotFoundException(MessageFactory.get(
                        "error.unreachable.property", property));
            }
        }
        if (base == null) {
            throw new PropertyNotFoundException(MessageFactory.get(
                    "error.unreachable.property", property));
        }
    }

    Target t = new Target();
    t.base = base;
    t.property = property;
    return t;
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:67,代碼來源:AstValue.java

示例15: getTarget

import javax.el.ELResolver; //導入方法依賴的package包/類
private final Target getTarget(EvaluationContext ctx) throws ELException {
    // evaluate expr-a to value-a
    Object base = this.children[0].getValue(ctx);

    // if our base is null (we know there are more properites to evaluate)
    if (base == null) {
        throw new PropertyNotFoundException(MessageFactory.get(
                "error.unreachable.base", this.children[0].getImage()));
    }

    // set up our start/end
    Object property = null;
    int propCount = this.jjtGetNumChildren() - 1;
    int i = 1;

    // evaluate any properties before our target
    ELResolver resolver = ctx.getELResolver();
    if (propCount > 1) {
        while (base != null && i < propCount) {
            property = this.children[i].getValue(ctx);
            ctx.setPropertyResolved(false);
            base = resolver.getValue(ctx, base, property);
            i++;
        }
        // if we are in this block, we have more properties to resolve,
        // but our base was null
        if (base == null || property == null) {
            throw new PropertyNotFoundException(MessageFactory.get(
                    "error.unreachable.property", property));
        }
    }

    property = this.children[i].getValue(ctx);

    if (property == null) {
        throw new PropertyNotFoundException(MessageFactory.get(
                "error.unreachable.property", this.children[i]));
    }

    Target t = new Target();
    t.base = base;
    t.property = property;
    return t;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:45,代碼來源:AstValue.java


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