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


Java UifDictionaryBean.getPropertyExpressions方法代碼示例

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


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

示例1: evaluatePropertyExpression

import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void evaluatePropertyExpression(View view, Map<String, Object> evaluationParameters,
        UifDictionaryBean expressionConfigurable, String propertyName, boolean removeExpression) {

    Map<String, String> propertyExpressions = expressionConfigurable.getPropertyExpressions();
    if ((propertyExpressions == null) || !propertyExpressions.containsKey(propertyName)) {
        return;
    }

    String expression = propertyExpressions.get(propertyName);

    // If the property name is a default value which grabs a new sequence number don't evaluate the expression
    // since a new sequence number has already been retrieved.
    if (StringUtils.equals(propertyName, UifConstants.ComponentProperties.DEFAULT_VALUE) &&
            StringUtils.contains(expression, UifConstants.SEQUENCE_PREFIX)) {
        return;
    }

    // check whether expression should be evaluated or property should retain the expression
    if (CopyUtils.fieldHasAnnotation(expressionConfigurable.getClass(), propertyName, KeepExpression.class)) {
        // set expression as property value to be handled by the component
        ObjectPropertyUtils.setPropertyValue(expressionConfigurable, propertyName, expression);
        return;
    }

    Object propertyValue = null;

    // replace binding prefixes (lp, dp, fp) in expression before evaluation
    String adjustedExpression = replaceBindingPrefixes(view, expressionConfigurable, expression);

    // determine whether the expression is a string template, or evaluates to another object type
    if (StringUtils.startsWith(adjustedExpression, UifConstants.EL_PLACEHOLDER_PREFIX) && StringUtils.endsWith(
            adjustedExpression, UifConstants.EL_PLACEHOLDER_SUFFIX) && (StringUtils.countMatches(adjustedExpression,
            UifConstants.EL_PLACEHOLDER_PREFIX) == 1)) {
        propertyValue = evaluateExpression(evaluationParameters, adjustedExpression);
    } else {
        // treat as string template
        propertyValue = evaluateExpressionTemplate(evaluationParameters, adjustedExpression);
    }

    // if property name has the special indicator then we need to add the expression result to the property
    // value instead of replace
    if (StringUtils.endsWith(propertyName, ExpressionEvaluator.EMBEDDED_PROPERTY_NAME_ADD_INDICATOR)) {
        StringUtils.removeEnd(propertyName, ExpressionEvaluator.EMBEDDED_PROPERTY_NAME_ADD_INDICATOR);

        Collection collectionValue = ObjectPropertyUtils.getPropertyValue(expressionConfigurable, propertyName);
        if (collectionValue == null) {
            throw new RuntimeException("Property name: " + propertyName
                    + " with collection type was not initialized. Cannot add expression result");
        }
        collectionValue.add(propertyValue);
    } else {
        ObjectPropertyUtils.setPropertyValue(expressionConfigurable, propertyName, propertyValue);
    }

    if (removeExpression) {
        propertyExpressions.remove(propertyName);
    }
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:63,代碼來源:DefaultExpressionEvaluator.java

示例2: evaluatePropertyExpressions

import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //導入方法依賴的package包/類
/**
 * Iterates through the keys of the property expressions map and invokes
 * {@link #evaluatePropertyExpression(org.kuali.rice.krad.uif.view.View, java.util.Map,
 * org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean, String, boolean)}
 *
 * <p>
 * If the expression is an el template (part static text and part expression), only the
 * expression part will be replaced with the result. More than one expressions may be contained
 * within the template
 * </p>
 *
 * @param view - view instance that is being rendered
 * @param expressionConfigurable - object instance to evaluate expressions for
 * @param evaluationParameters - map of additional parameters that may be used within the
 * expressions
 */
protected void evaluatePropertyExpressions(View view, UifDictionaryBean expressionConfigurable,
        Map<String, Object> evaluationParameters) {
    if (expressionConfigurable == null) {
        return;
    }

    Map<String, String> propertyExpressions = expressionConfigurable.getPropertyExpressions();
    if (propertyExpressions == null) {
        return;
    }

    for (String propertyName : propertyExpressions.keySet()) {
        evaluatePropertyExpression(view, evaluationParameters, expressionConfigurable, propertyName, false);
    }
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:32,代碼來源:DefaultExpressionEvaluator.java

示例3: evaluatePropertyExpression

import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //導入方法依賴的package包/類
/**
 * @see org.kuali.rice.krad.uif.view.ExpressionEvaluator#evaluatePropertyExpression(View, java.util.Map,
 * org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean, String, boolean)
 */
public void evaluatePropertyExpression(View view, Map<String, Object> evaluationParameters,
        UifDictionaryBean expressionConfigurable, String propertyName, boolean removeExpression) {

    Map<String, String> propertyExpressions = expressionConfigurable.getPropertyExpressions();
    if ((propertyExpressions == null) || !propertyExpressions.containsKey(propertyName)) {
        return;
    }

    String expression = propertyExpressions.get(propertyName);

    // check whether expression should be evaluated or property should retain the expression
    if (CloneUtils.fieldHasAnnotation(expressionConfigurable.getClass(), propertyName, KeepExpression.class)) {
        // set expression as property value to be handled by the component
        ObjectPropertyUtils.setPropertyValue(expressionConfigurable, propertyName, expression);
        return;
    }

    Object propertyValue = null;

    // replace binding prefixes (lp, dp, fp) in expression before evaluation
    String adjustedExpression = replaceBindingPrefixes(view, expressionConfigurable, expression);

    // determine whether the expression is a string template, or evaluates to another object type
    if (StringUtils.startsWith(adjustedExpression, UifConstants.EL_PLACEHOLDER_PREFIX) && StringUtils.endsWith(
            adjustedExpression, UifConstants.EL_PLACEHOLDER_SUFFIX) && (StringUtils.countMatches(adjustedExpression,
            UifConstants.EL_PLACEHOLDER_PREFIX) == 1)) {
        propertyValue = evaluateExpression(evaluationParameters, adjustedExpression);
    } else {
        // treat as string template
        propertyValue = evaluateExpressionTemplate(evaluationParameters, adjustedExpression);
    }

    // if property name has the special indicator then we need to add the expression result to the property
    // value instead of replace
    if (StringUtils.endsWith(propertyName, ExpressionEvaluator.EMBEDDED_PROPERTY_NAME_ADD_INDICATOR)) {
        StringUtils.removeEnd(propertyName, ExpressionEvaluator.EMBEDDED_PROPERTY_NAME_ADD_INDICATOR);

        Collection collectionValue = ObjectPropertyUtils.getPropertyValue(expressionConfigurable, propertyName);
        if (collectionValue == null) {
            throw new RuntimeException("Property name: "
                    + propertyName
                    + " with collection type was not initialized. Cannot add expression result");
        }
        collectionValue.add(propertyValue);
    } else {
        ObjectPropertyUtils.setPropertyValue(expressionConfigurable, propertyName, propertyValue);
    }

    if (removeExpression) {
        propertyExpressions.remove(propertyName);
    }
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:57,代碼來源:DefaultExpressionEvaluator.java

示例4: evaluatePropertyExpressions

import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //導入方法依賴的package包/類
/**
 * Iterates through the keys of the property expressions map and invokes
 * {@link #evaluatePropertyExpression(org.kuali.rice.krad.uif.view.View, java.util.Map,
 * org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean, String, boolean)}
 *
 * <p>
 * If the expression is an el template (part static text and part expression), only the expression
 * part will be replaced with the result. More than one expressions may be contained within the template
 * </p>
 *
 * @param view - view instance that is being rendered
 * @param expressionConfigurable - object instance to evaluate expressions for
 * @param evaluationParameters - map of additional parameters that may be used within the expressions
 */
protected void evaluatePropertyExpressions(View view, UifDictionaryBean expressionConfigurable,
        Map<String, Object> evaluationParameters) {
    Map<String, String> propertyExpressions = expressionConfigurable.getPropertyExpressions();
    for (String propertyName : propertyExpressions.keySet()) {
        evaluatePropertyExpression(view, evaluationParameters, expressionConfigurable, propertyName, false);
    }
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:22,代碼來源:DefaultExpressionEvaluator.java

示例5: hasValueOrPropertyExpression

import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //導入方法依賴的package包/類
/**
 * Helper function to check if value or property expression exists
 *
 * @param defaultValue
 * @param dictionaryBean
 * @param expressionName
 * @return
 */
private boolean hasValueOrPropertyExpression(String defaultValue, UifDictionaryBean dictionaryBean, String expressionName) {
    return StringUtils.isNotBlank(defaultValue) || (dictionaryBean != null && dictionaryBean.getPropertyExpressions() != null &&
            StringUtils.isNotBlank(dictionaryBean.getPropertyExpression(expressionName)));
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:13,代碼來源:Help.java


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