Example usage for javax.el ValueExpression getValue

List of usage examples for javax.el ValueExpression getValue

Introduction

In this page you can find the example usage for javax.el ValueExpression getValue.

Prototype

public abstract Object getValue(ELContext context);

Source Link

Usage

From source file:org.nuxeo.ecm.platform.ui.web.directory.ChainSelectBase.java

public String getDirectoryNames() {
    ValueExpression ve = getValueExpression("directoryNames");
    if (ve != null) {
        return (String) ve.getValue(FacesContext.getCurrentInstance().getELContext());
    } else {/*from   w  w  w  .  ja  va2  s  .c o m*/
        return directoryNames;
    }
}

From source file:org.nuxeo.ecm.platform.ui.web.directory.ChainSelectBase.java

public boolean getQualifiedParentKeys() {
    ValueExpression ve = getValueExpression("qualifiedParentKeys");
    if (ve != null) {
        return (Boolean) ve.getValue(FacesContext.getCurrentInstance().getELContext());
    } else {/* ww  w.  j a v  a 2  s . c o  m*/
        return qualifiedParentKeys;
    }
}

From source file:org.nuxeo.ecm.platform.ui.web.directory.ChainSelectBase.java

public boolean getAllowBranchSelection() {
    ValueExpression ve = getValueExpression("allowBranchSelection");
    if (ve != null) {
        return (Boolean) ve.getValue(FacesContext.getCurrentInstance().getELContext());
    } else {//from   ww w . j  ava  2  s .c om
        return allowBranchSelection;
    }
}

From source file:org.nuxeo.ecm.platform.ui.web.directory.ChainSelectBase.java

public boolean getDisplayValueOnly() {
    ValueExpression ve = getValueExpression("displayValueOnly");
    if (ve != null) {
        Boolean value = (Boolean) ve.getValue(FacesContext.getCurrentInstance().getELContext());
        return value == null ? false : value;
    } else {/* w  w w  .  j av a 2 s  .  co m*/
        return displayValueOnly;
    }
}

From source file:org.nuxeo.ecm.platform.ui.web.directory.ChainSelectBase.java

public boolean getTranslate() {
    ValueExpression ve_translate = getValueExpression("translate");
    if (ve_translate != null) {
        return (Boolean) ve_translate.getValue(FacesContext.getCurrentInstance().getELContext());
    } else {/*from  www .j  a v a 2s. c o m*/
        return translate;
    }
}

From source file:org.richfaces.taglib.ColumnsHandler.java

/**
 * Return expression for page variables//from w  ww .  j  av a2s.c  o  m
 * 
 * @param expr
 * @return
 */
private ValueExpression getVarExpression(FaceletContext ctx,
        ValueExpression expr/*, IterationContext itContext*/) {
    IterationContext itContext = getIterationContext();
    Object o = expr.getValue(ctx.getFacesContext().getELContext());
    int k = itContext._index;
    if (o.getClass().isArray() || o instanceof List) {
        return new IndexedValueExpression(expr, k);
    }

    if (o instanceof Collection || o instanceof Iterator || o instanceof Enumeration || o instanceof Map
            || o instanceof String) {

        if (itContext.iteratedExpression == null) {
            itContext.iteratedExpression = new IteratedExpression(expr, ",");
        }
        return new IteratedValueExpression(itContext.iteratedExpression, k);
    }

    throw new ELException("FOREACH_BAD_ITEMS");
}

From source file:org.nuxeo.ecm.platform.ui.web.component.document.RestDocumentLink.java

public String getTab() {
    if (tab != null) {
        return tab;
    }//from w  w w  .  j  av a  2s  .c  o m
    ValueExpression ve = getValueExpression("tab");
    if (ve != null) {
        try {
            return (String) ve.getValue(getFacesContext().getELContext());
        } catch (ELException e) {
            throw new FacesException(e);
        }
    } else {
        return null;
    }
}

From source file:org.nuxeo.ecm.platform.ui.web.component.document.RestDocumentLink.java

public String getVar() {
    if (var != null) {
        return var;
    }/*w  w  w. j  a v  a  2  s  .c  o  m*/
    ValueExpression ve = getValueExpression("var");
    if (ve != null) {
        try {
            return (String) ve.getValue(getFacesContext().getELContext());
        } catch (ELException e) {
            throw new FacesException(e);
        }
    } else {
        return null;
    }
}

From source file:org.apache.myfaces.config.ManagedBeanBuilder.java

private void initializeList(FacesContext facesContext, ListEntries listEntries, List<? super Object> list) {
    Application application = facesContext.getApplication();

    Class<?> valueClass = (listEntries.getValueClass() == null) ? String.class
            : ClassUtils.simpleJavaTypeToClass(listEntries.getValueClass());

    ExpressionFactory expFactory = application.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();

    for (Iterator<? extends ListEntry> iterator = listEntries.getListEntries(); iterator.hasNext();) {
        ListEntry entry = iterator.next();
        if (entry.isNullValue()) {
            list.add(null);/* w  ww.j  a v a  2  s  .co m*/
        } else {
            Object value = entry.getValue();
            if (ContainerUtils.isValueReference((String) value)) {
                ValueExpression valueExpression = expFactory.createValueExpression(elContext, (String) value,
                        Object.class);
                value = valueExpression.getValue(elContext);
            }

            list.add(coerceToType(facesContext, value, valueClass));
        }
    }
}

From source file:org.nuxeo.ecm.platform.ui.web.component.document.RestDocumentLink.java

public String getView() {
    if (view != null) {
        return view;
    }/*from  w w  w.j  av a2s  .com*/
    ValueExpression ve = getValueExpression("view");
    if (ve != null) {
        try {
            return (String) ve.getValue(getFacesContext().getELContext());
        } catch (ELException e) {
            throw new FacesException(e);
        }
    } else {
        return null;
    }
}