本文整理匯總了Java中net.sourceforge.stripes.util.bean.PropertyExpression類的典型用法代碼示例。如果您正苦於以下問題:Java PropertyExpression類的具體用法?Java PropertyExpression怎麽用?Java PropertyExpression使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PropertyExpression類屬於net.sourceforge.stripes.util.bean包,在下文中一共展示了PropertyExpression類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: evaluate
import net.sourceforge.stripes.util.bean.PropertyExpression; //導入依賴的package包/類
public void evaluate(NoAnnotation bean) throws Exception {
String[] properties = bean.getTestProperties();
boolean[] expect = bean.getExpectSuccess();
Class<? extends NoAnnotation> beanType = bean.getClass();
MockRoundtrip trip = new MockRoundtrip(getMockServletContext(), beanType);
for (String p : properties)
trip.addParameter(p, p + "Value");
trip.execute();
bean = trip.getActionBean(beanType);
for (int i = 0; i < properties.length; i++) {
String fullName = beanType.getSimpleName() + "." + properties[i];
log.debug("Testing binding security on ", fullName);
PropertyExpression pe = PropertyExpression.getExpression(properties[i]);
PropertyExpressionEvaluation eval = new PropertyExpressionEvaluation(pe, bean);
Object value = eval.getValue();
Assert.assertEquals(value != null, expect[i], "Property " + fullName + " should"
+ (expect[i] ? " not" : "") + " be null but it is" + (expect[i] ? "" : " not"));
}
}