当前位置: 首页>>代码示例>>Java>>正文


Java UserMessages.toPropertySet方法代码示例

本文整理汇总了Java中org.lastaflute.core.message.UserMessages.toPropertySet方法的典型用法代码示例。如果您正苦于以下问题:Java UserMessages.toPropertySet方法的具体用法?Java UserMessages.toPropertySet怎么用?Java UserMessages.toPropertySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lastaflute.core.message.UserMessages的用法示例。


在下文中一共展示了UserMessages.toPropertySet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupItemMessages

import org.lastaflute.core.message.UserMessages; //导入方法依赖的package包/类
protected void setupItemMessages(ExceptionMessageBuilder br, UserMessages messages) {
    br.addItem("Messages");
    final Set<String> propertySet = messages.toPropertySet();
    for (String property : propertySet) {
        br.addElement(property);
        for (Iterator<UserMessage> ite = messages.accessByIteratorOf(property); ite.hasNext();) {
            br.addElement("  " + ite.next());
        }
    }
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:11,代码来源:ResponseBeanValidator.java

示例2: toApplicationMessageList

import org.lastaflute.core.message.UserMessages; //导入方法依赖的package包/类
protected List<LaApplicationMessage> toApplicationMessageList(UserMessages messages) {
    final List<LaApplicationMessage> convertedList = new ArrayList<LaApplicationMessage>(messages.size());
    for (String property : messages.toPropertySet()) {
        for (Iterator<UserMessage> ite = messages.accessByIteratorOf(property); ite.hasNext();) {
            final UserMessage message = ite.next();
            verifyResourceMessage(messages, message);
            convertedList.add(toApplicationMessage(property, message));
        }
    }
    return convertedList;
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:12,代码来源:MessagingApplicationException.java

示例3: test_toUserMessages

import org.lastaflute.core.message.UserMessages; //导入方法依赖的package包/类
public void test_toUserMessages() throws Exception {
    // ## Arrange ##
    ActionValidator<UserMessages> validator = createValidator();
    MockForm form = new MockForm();
    Set<ConstraintViolation<Object>> vioSet = new HashSet<ConstraintViolation<Object>>();
    vioSet.add(createViolation("sea"));
    vioSet.add(createViolation("land.oneman"));
    vioSet.add(createViolation("land.minio"));
    vioSet.add(createViolation("piari"));
    vioSet.add(createViolation("piari[0].dstore"));
    vioSet.add(createViolation("piari[2].dstore"));
    vioSet.add(createViolation("piari[2].plaza"));
    vioSet.add(createViolation("piari[3].plaza"));
    vioSet.add(createViolation("piari[5].dstore"));

    // ## Act ##
    UserMessages messages = validator.toUserMessages(form, vioSet);

    // ## Assert ##
    Set<String> propertySet = messages.toPropertySet();
    assertHasAnyElement(propertySet);
    log(propertySet);
    assertEquals(vioSet.size(), propertySet.size());
    List<UserMessage> messageList = new ArrayList<UserMessage>();
    for (String property : propertySet) {
        for (Iterator<UserMessage> iterator = messages.accessByIteratorOf(property); iterator.hasNext();) {
            messageList.add(iterator.next());
        }
    }
    for (UserMessage message : messageList) {
        log(message);
    }
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:34,代码来源:ActionValidatorTest.java


注:本文中的org.lastaflute.core.message.UserMessages.toPropertySet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。