本文整理汇总了Java中org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean类的典型用法代码示例。如果您正苦于以下问题:Java UifDictionaryBean类的具体用法?Java UifDictionaryBean怎么用?Java UifDictionaryBean使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UifDictionaryBean类属于org.kuali.rice.krad.datadictionary.uif包,在下文中一共展示了UifDictionaryBean类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluatePropertyReplacers
import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //导入依赖的package包/类
/**
* Iterates through any configured <code>PropertyReplacer</code> instances for the component and
* evaluates the given condition. If the condition is met, the replacement value is set on the
* corresponding property
*
* @param view - view instance being rendered
* @param expressionConfigurable - expressionConfigurable instance with property replacers list,
* should be either a component or layout manager
* @param evaluationParameters - parameters for el evaluation
*/
protected void evaluatePropertyReplacers(View view, UifDictionaryBean expressionConfigurable,
Map<String, Object> evaluationParameters) {
List<PropertyReplacer> replacers = null;
if (Component.class.isAssignableFrom(expressionConfigurable.getClass())) {
replacers = ((Component) expressionConfigurable).getPropertyReplacers();
} else if (LayoutManager.class.isAssignableFrom(expressionConfigurable.getClass())) {
replacers = ((LayoutManager) expressionConfigurable).getPropertyReplacers();
}
if (replacers != null) {
for (PropertyReplacer propertyReplacer : replacers) {
String expression = propertyReplacer.getCondition();
String adjustedExpression = replaceBindingPrefixes(view, expressionConfigurable, expression);
String conditionEvaluation = evaluateExpressionTemplate(evaluationParameters, adjustedExpression);
boolean conditionSuccess = Boolean.parseBoolean(conditionEvaluation);
if (conditionSuccess) {
ObjectPropertyUtils.setPropertyValue(expressionConfigurable, propertyReplacer.getPropertyName(),
propertyReplacer.getReplacement());
}
}
}
}
示例2: evaluatePropertyReplacers
import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //导入依赖的package包/类
/**
* Iterates through any configured <code>PropertyReplacer</code> instances for the component and
* evaluates the given condition. If the condition is met, the replacement value is set on the
* corresponding property
*
* @param view - view instance being rendered
* @param expressionConfigurable - expressionConfigurable instance with property replacers list, should be either a
* component or layout manager
* @param evaluationParameters - parameters for el evaluation
*/
protected void evaluatePropertyReplacers(View view, UifDictionaryBean expressionConfigurable,
Map<String, Object> evaluationParameters) {
List<PropertyReplacer> replacers = null;
if (Component.class.isAssignableFrom(expressionConfigurable.getClass())) {
replacers = ((Component) expressionConfigurable).getPropertyReplacers();
} else if (LayoutManager.class.isAssignableFrom(expressionConfigurable.getClass())) {
replacers = ((LayoutManager) expressionConfigurable).getPropertyReplacers();
}
for (PropertyReplacer propertyReplacer : replacers) {
String expression = propertyReplacer.getCondition();
String adjustedExpression = replaceBindingPrefixes(view, expressionConfigurable, expression);
String conditionEvaluation = evaluateExpressionTemplate(evaluationParameters, adjustedExpression);
boolean conditionSuccess = Boolean.parseBoolean(conditionEvaluation);
if (conditionSuccess) {
ObjectPropertyUtils.setPropertyValue(expressionConfigurable, propertyReplacer.getPropertyName(),
propertyReplacer.getReplacement());
}
}
}
示例3: performLifecycleTask
import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void performLifecycleTask() {
// the component can have an expression graph for which the expressions need pulled to
// the list the expression service will evaluate
ViewLifecycle.getExpressionEvaluator().populatePropertyExpressionsFromGraph(
(UifDictionaryBean) getElementState().getElement(), true);
}
示例4: evaluateExpressionsOnConfigurable
import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void evaluateExpressionsOnConfigurable(View view, UifDictionaryBean expressionConfigurable,
Map<String, Object> evaluationParameters) {
if ((expressionConfigurable instanceof Component) || (expressionConfigurable instanceof LayoutManager)) {
evaluatePropertyReplacers(view, expressionConfigurable, evaluationParameters);
}
evaluatePropertyExpressions(view, expressionConfigurable, evaluationParameters);
}
示例5: runValidationsOnLifecycle
import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //导入依赖的package包/类
/**
* Runs the validations on a components lifecycle items
*
* @param element - The component whose lifecycle items are being checked
* @param tracer - The current bean trace for the validation line
*/
private void runValidationsOnLifecycle(LifecycleElement element, ValidationTrace tracer) {
Map<String, LifecycleElement> nestedComponents =
ViewLifecycleUtils.getElementsForLifecycle(element, UifConstants.ViewPhases.INITIALIZE);
if (nestedComponents == null) {
return;
}
Component component = null;
if (element instanceof Component) {
component = (Component) element;
if (!doValidationOnUIFBean(component)) {
return;
}
tracer.addBean(component);
}
for (LifecycleElement temp : nestedComponents.values()) {
if (!(temp instanceof Component)) {
continue;
}
if (tracer.getValidationStage() == ValidationTrace.START_UP) {
ViewLifecycle.getExpressionEvaluator().populatePropertyExpressionsFromGraph((UifDictionaryBean) temp, false);
}
if (((Component) temp).isRender()) {
((DataDictionaryEntry) temp).completeValidation(tracer.getCopy());
runValidationsOnLifecycle(temp, tracer.getCopy());
}
}
ViewLifecycleUtils.recycleElementMap(nestedComponents);
}
示例6: evaluateExpressionsOnConfigurable
import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //导入依赖的package包/类
/**
* org.kuali.rice.krad.uif.view.ExpressionEvaluator#evaluateExpressionsOnConfigurable(
* org.kuali.rice.krad.uif.view.View, org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean,
* java.util.Map<java.lang.String,java.lang.Object>)
*/
public void evaluateExpressionsOnConfigurable(View view, UifDictionaryBean expressionConfigurable,
Map<String, Object> evaluationParameters) {
if ((expressionConfigurable instanceof Component) || (expressionConfigurable instanceof LayoutManager)) {
evaluatePropertyReplacers(view, expressionConfigurable, evaluationParameters);
}
evaluatePropertyExpressions(view, expressionConfigurable, evaluationParameters);
}
示例7: processBeanDefinition
import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //导入依赖的package包/类
/**
* Processes a top level (non nested) bean definition for expressions
*
* <p>
* A bean that is non nested (or top of a collection) will hold all the expressions for the graph. A new
* expression graph is initialized and expressions are collected as the bean and all its children are processed.
* The expression graph is then set as a property on the top bean definition
* </p>
*
* @param beanName name of the bean to process
* @param beanDefinition bean definition to process
* @param beanFactory factory holding all the bean definitions
* @param processedBeanNames set of bean names that have already been processed
*/
protected void processBeanDefinition(String beanName, BeanDefinition beanDefinition,
ConfigurableListableBeanFactory beanFactory, Set<String> processedBeanNames) {
Class<?> beanClass = getBeanClass(beanDefinition, beanFactory);
if ((beanClass == null) || !UifDictionaryBean.class.isAssignableFrom(beanClass) || processedBeanNames.contains(
beanName)) {
return;
}
// process bean definition and all nested definitions for expressions
ManagedMap<String, String> expressionGraph = new ManagedMap<String, String>();
MutablePropertyValues pvs = beanDefinition.getPropertyValues();
if (pvs.contains(UifPropertyPaths.EXPRESSION_GRAPH)) {
expressionGraph = (ManagedMap<String, String>) pvs.getPropertyValue(UifPropertyPaths.EXPRESSION_GRAPH)
.getValue();
if (expressionGraph == null) {
expressionGraph = new ManagedMap<String, String>();
}
}
expressionGraph.setMergeEnabled(false);
processNestedBeanDefinition(beanName, beanDefinition, "", expressionGraph, beanFactory, processedBeanNames);
// add property for expression graph
pvs = beanDefinition.getPropertyValues();
pvs.addPropertyValue(UifPropertyPaths.EXPRESSION_GRAPH, expressionGraph);
}
示例8: PopulateComponentFromExpressionGraphTask
import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //导入依赖的package包/类
/**
* Default constructor.
*/
public PopulateComponentFromExpressionGraphTask() {
super(UifDictionaryBean.class);
}
示例9: 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);
}
}
示例10: 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);
}
}
示例11: addBean
import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //导入依赖的package包/类
/**
* Adds a UIF Configurable to the trace
*
* @param configurable - The object to be added
*/
public void addBean(UifDictionaryBean configurable) {
String beanId = "configurable";
String beanType = configurable.getClass().getSimpleName();
addBean(beanType, beanId);
}
示例12: 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);
}
}
示例13: 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);
}
}
示例14: evaluateExpressionsOnConfigurable
import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //导入依赖的package包/类
/**
* Evaluates any el expressions that are found as a string property value
* for the object
*
* <p>
* Using reflection the properties for the object are retrieved and if of
* <code>String</code> type the corresponding value is retrieved. If the
* value is not empty and contains the el placeholder see
* {@link #containsElPlaceholder(String)} then the expression is evaluated
* using the given context object and parameters. The evaluated string is
* then set as the new property value, or in the case of a template
* (expression contained within a literal string), the expression part is
* replaced in the property value.
* </p>
*
* <p>
* In addition to evaluating any property expressions, any configured
* <code>PropertyReplacer</code> for the object are also evaluated and if a
* match occurs those property replacements are made
* </p>
*
* @param view view instance being rendered
* @param expressionConfigurable object whose properties should be checked for expressions
* and evaluated
* @param evaluationParameters map of parameters that may appear in expressions, the map
* key gives the parameter name that may appear in the expression, and the map value is the object that expression
* should evaluate against when that name is found
*/
void evaluateExpressionsOnConfigurable(View view, UifDictionaryBean expressionConfigurable,
Map<String, Object> evaluationParameters);
示例15: evaluatePropertyExpression
import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; //导入依赖的package包/类
/**
* Evaluates the configured expression for the given property name (if not exists) on the given configurable
*
* @param view view instance the configurable is associated with, used to adjust binding prefixes
* @param evaluationParameters map that will be exposed as EL parameters
* @param expressionConfigurable configurable object to pull and evaluate the expression on
* @param propertyName name of the property whose expression should be evaluated
* @param removeExpression boolean that indicates whether the expression should be removed after evaluation
*/
void evaluatePropertyExpression(View view, Map<String, Object> evaluationParameters,
UifDictionaryBean expressionConfigurable, String propertyName, boolean removeExpression);