當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。