本文整理汇总了Java中org.springframework.util.AutoPopulatingList类的典型用法代码示例。如果您正苦于以下问题:Java AutoPopulatingList类的具体用法?Java AutoPopulatingList怎么用?Java AutoPopulatingList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AutoPopulatingList类属于org.springframework.util包,在下文中一共展示了AutoPopulatingList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: showErrorMap
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* This method is used during debugging to dump the contents of the error map, including the key names. It is not
* used by the
* application in normal circumstances at all.
*/
protected void showErrorMap() {
if (GlobalVariables.getMessageMap().hasNoErrors()) {
return;
}
for (Iterator i = GlobalVariables.getMessageMap().getAllPropertiesAndErrors().iterator(); i.hasNext(); ) {
Map.Entry e = (Map.Entry) i.next();
AutoPopulatingList errorList = (AutoPopulatingList) e.getValue();
for (Iterator j = errorList.iterator(); j.hasNext(); ) {
ErrorMessage em = (ErrorMessage) j.next();
if (em.getMessageParameters() == null) {
LOG.error(e.getKey().toString() + " = " + em.getErrorKey());
} else {
LOG.error(e.getKey().toString() + " = " + em.getErrorKey() + " : " +
Arrays.toString(em.getMessageParameters()));
}
}
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:MaintenanceDocumentRuleBase.java
示例2: showErrorMap
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* This method is used during debugging to dump the contents of the error map, including the key names. It is not
* used by the
* application in normal circumstances at all.
*/
protected void showErrorMap() {
if (GlobalVariables.getMessageMap().hasNoErrors()) {
return;
}
for (Iterator i = GlobalVariables.getMessageMap().getAllPropertiesAndErrors().iterator(); i.hasNext(); ) {
Map.Entry e = (Map.Entry) i.next();
AutoPopulatingList errorList = (AutoPopulatingList) e.getValue();
for (Iterator j = errorList.iterator(); j.hasNext(); ) {
ErrorMessage em = (ErrorMessage) j.next();
if (em.getMessageParameters() == null) {
LOG.error(e.getKey().toString() + " = " + em.getErrorKey());
} else {
LOG.error(e.getKey().toString() + " = " + em.getErrorKey() + " : " +
Arrays.toString(em.getMessageParameters()));
}
}
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:MaintenanceDocumentRuleBase.java
示例3: copyAllMessagesHelper
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
private void copyAllMessagesHelper(Map<String, AutoPopulatingList<ErrorMessage>> sourceMessages, String type, MessageMap destMap) {
for (String key : sourceMessages.keySet()) {
AutoPopulatingList<ErrorMessage> messages = sourceMessages.get(key);
if (messages != null) {
for (Object o : messages) {
ErrorMessage message = (ErrorMessage) o;
if ("info".equals(type)) {
destMap.putInfoWithoutFullErrorPath(key, message.getErrorKey(), message.getMessageParameters());
}
else if ("warning".equals(type)) {
destMap.putWarningWithoutFullErrorPath(key, message.getErrorKey(), message.getMessageParameters());
}
else if ("error".equals(type)) {
destMap.putErrorWithoutFullErrorPath(key, message.getErrorKey(), message.getMessageParameters());
}
else {
throw new IllegalArgumentException();
}
}
}
}
}
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:23,代码来源:CollectorFlatFileInputType.java
示例4: processContactValidation
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* A stub method as placeholder for future Contact Validation
*
* @param document MaintenanceDocument instance
* @return boolean false or true
*/
private boolean processContactValidation(MaintenanceDocument document) {
boolean valid = true;
int i = 0;
for (VendorContact contact : newVendor.getVendorContacts()) {
String errorPath = MAINTAINABLE_ERROR_PREFIX + VendorPropertyConstants.VENDOR_CONTACT + "[" + i + "]";
GlobalVariables.getMessageMap().addToErrorPath(errorPath);
this.getDictionaryValidationService().validateBusinessObject(contact);
Map<String, AutoPopulatingList<ErrorMessage>> errors = GlobalVariables.getMessageMap().getErrorMessages();
if ((errors != null ) && (!errors.isEmpty())) {
valid = false;
}
i++;
GlobalVariables.getMessageMap().clearErrorPath();
}
return valid;
}
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:24,代码来源:VendorRule.java
示例5: showMessageMap
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
*
* This method is used during debugging to dump the contents of the error map, including the key names. It is not used by the
* application in normal circumstances at all.
*
*/
private void showMessageMap() {
if (GlobalVariables.getMessageMap().hasErrors()) {
return;
}
Set<String> errorMapKeys = ((Map<String, String>) GlobalVariables.getMessageMap()).keySet();
AutoPopulatingList<ErrorMessage> errorMapEntry;
for (String errorMapKey : errorMapKeys) {
errorMapEntry = (AutoPopulatingList<ErrorMessage>) (GlobalVariables.getMessageMap()).getMessages(errorMapKey);
for (ErrorMessage errorMessage : errorMapEntry) {
if (errorMessage.getMessageParameters() == null) {
LOG.error("[" + errorMapKey + "] " + errorMessage.getErrorKey());
}
else {
LOG.error("[" + errorMapKey + "] " + errorMessage.getErrorKey() + " == " + parseStringArray(errorMessage.getMessageParameters()));
}
}
}
}
开发者ID:kuali,项目名称:kfs,代码行数:28,代码来源:CustomerLoadBusinessRulesTest.java
示例6: showErrorMap
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* This method is used during debugging to dump the contents of the error map, including the key names. It is not
* used by the
* application in normal circumstances at all.
*/
protected void showErrorMap() {
if (GlobalVariables.getMessageMap().hasNoErrors()) {
return;
}
for (Iterator i = GlobalVariables.getMessageMap().getAllPropertiesAndErrors().iterator(); i.hasNext(); ) {
Map.Entry e = (Map.Entry) i.next();
AutoPopulatingList errorList = (AutoPopulatingList) e.getValue();
for (Iterator j = errorList.iterator(); j.hasNext(); ) {
ErrorMessage em = (ErrorMessage) j.next();
if (em.getMessageParameters() == null) {
LOG.error(e.getKey().toString() + " = " + em.getErrorKey());
} else {
LOG.error(e.getKey().toString() + " = " + em.getErrorKey() + " : " +
em.getMessageParameters().toString());
}
}
}
}
开发者ID:kuali,项目名称:rice,代码行数:27,代码来源:MaintenanceDocumentRuleBase.java
示例7: SerializerServiceBase
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
public SerializerServiceBase() {
serializationStates = new ThreadLocal<SerializationState>();
evaluators = new ThreadLocal<PropertySerializabilityEvaluator>();
xstream = new XStream(new ProxyAndStateAwareJavaReflectionProvider());
xstream.registerConverter(new ProxyConverter(xstream.getMapper(), xstream.getReflectionProvider() ));
try {
Class<?> objListProxyClass = Class.forName("org.apache.ojb.broker.core.proxy.ListProxyDefaultImpl");
xstream.addDefaultImplementation(ArrayList.class, objListProxyClass);
xstream.addDefaultImplementation(AutoPopulatingList.class, objListProxyClass);
} catch ( Exception ex ) {
// Do nothing - this will blow if the OJB class does not exist, which it won't in some installs
}
xstream.registerConverter(new AutoPopulatingListConverter(xstream.getMapper()));
xstream.registerConverter(new DateTimeConverter());
}
开发者ID:kuali,项目名称:rice,代码行数:17,代码来源:SerializerServiceBase.java
示例8: showErrorMap
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* This method is used during debugging to dump the contents of the error map, including the key names. It is not
* used by the
* application in normal circumstances at all.
*/
protected void showErrorMap() {
if (GlobalVariables.getMessageMap().hasNoErrors()) {
return;
}
for (Iterator i = GlobalVariables.getMessageMap().getAllPropertiesAndErrors().iterator(); i.hasNext(); ) {
Map.Entry e = (Map.Entry) i.next();
AutoPopulatingList errorList = (AutoPopulatingList) e.getValue();
for (Iterator j = errorList.iterator(); j.hasNext(); ) {
ErrorMessage em = (ErrorMessage) j.next();
if (em.getMessageParameters() == null) {
LOG.error(e.getKey().toString() + " = " + em.getErrorKey());
} else {
LOG.error(e.getKey().toString() + " = " + em.getErrorKey() + " : " +
em.getMessageParameters().toString());
}
}
}
}
开发者ID:kuali,项目名称:rice,代码行数:28,代码来源:MaintenanceDocumentRuleBase.java
示例9: testRetrieveMessage_namespaceKey
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* Test that message text is correctly retrieved for a validation message specified by namespace and
* message key
*/
@Test
public void testRetrieveMessage_namespaceKey() throws Exception {
ErrorMessage errorMessage = new ErrorMessage();
errorMessage.setNamespaceCode("KR-NS");
errorMessage.setErrorKey("testErrorKey");
messageMap.putError("field1", errorMessage);
AutoPopulatingList<ErrorMessage> fieldErrors = messageMap.getErrorMessagesForProperty("field1");
assertEquals("Incorrect number of messages for field1", 1, fieldErrors.size());
ErrorMessage message = fieldErrors.get(0);
String messageText = KRADUtils.getMessageText(message, true);
assertEquals("Message for field1 is not correct", "Error on field1", messageText);
}
开发者ID:aapotts,项目名称:kuali_rice,代码行数:20,代码来源:ValidationMessageRetrievalTest.java
示例10: testRetrieveMessage_componentKey
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* Test that message text is correctly retrieved for a validation message specified by namespace,
* component, and message key
*/
@Test
public void testRetrieveMessage_componentKey() throws Exception {
ErrorMessage errorMessage = new ErrorMessage();
errorMessage.setNamespaceCode("KR-NS");
errorMessage.setComponentCode("GeneralGroup");
errorMessage.setErrorKey("testErrorKey");
messageMap.putError("field1", errorMessage);
AutoPopulatingList<ErrorMessage> fieldErrors = messageMap.getErrorMessagesForProperty("field1");
assertEquals("Incorrect number of messages for field1", 1, fieldErrors.size());
ErrorMessage message = fieldErrors.get(0);
String messageText = KRADUtils.getMessageText(message, true);
assertEquals("Message for field1 is not correct", "Error on field1", messageText);
}
开发者ID:aapotts,项目名称:kuali_rice,代码行数:21,代码来源:ValidationMessageRetrievalTest.java
示例11: getMessages
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* Gets all the messages from the list of lists passed in (which are
* lists of ErrorMessages associated to the key) and uses the configuration
* service to get the message String associated. This will also combine
* error messages per a field if that option is turned on. If
* displayFieldLabelWithMessages is turned on, it will also find the label
* by key passed in.
*
* @param view
* @param key
* @param lists
* @return
*/
private List<String> getMessages(View view, String key, List<AutoPopulatingList<ErrorMessage>> lists) {
List<String> result = new ArrayList<String>();
for (List<ErrorMessage> errorList : lists) {
if (errorList != null && StringUtils.isNotBlank(key)) {
for (ErrorMessage e : errorList) {
String message = KRADUtils.getMessageText(e, true);
message = MessageStructureUtils.translateStringMessage(message);
result.add(message);
}
}
}
return result;
}
开发者ID:aapotts,项目名称:kuali_rice,代码行数:29,代码来源:ValidationMessages.java
示例12: merge
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* Takes one message map and merges it into another. Makes sure there are no duplicates.
*
* @param messagesFrom
* @param messagesTo
*/
public void merge(Map<String, AutoPopulatingList<ErrorMessage>> messagesFrom,
Map<String, AutoPopulatingList<ErrorMessage>> messagesTo) {
for (String key : messagesFrom.keySet()) {
if (messagesTo.containsKey(key)) {
// now we need to merge the messages
AutoPopulatingList<ErrorMessage> tal = messagesFrom.get(key);
AutoPopulatingList<ErrorMessage> parentList = messagesTo.get(key);
for (Object o : tal) {
if (!parentList.contains(o)) {
parentList.add((ErrorMessage) o);
}
}
} else {
messagesTo.put(key, messagesFrom.get(key));
}
}
}
开发者ID:aapotts,项目名称:kuali_rice,代码行数:29,代码来源:MessageMap.java
示例13: containsMessageKey
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* @return true if the given messageKey is associated with some property in this ErrorMap
*/
public boolean containsMessageKey(String messageKey) {
ErrorMessage foundMessage = null;
if (!hasNoErrors()) {
for (Iterator<Map.Entry<String, AutoPopulatingList<ErrorMessage>>> i =
getAllPropertiesAndErrors().iterator(); (foundMessage == null) && i.hasNext(); ) {
Map.Entry<String, AutoPopulatingList<ErrorMessage>> e = i.next();
AutoPopulatingList<ErrorMessage> entryErrorList = e.getValue();
for (Iterator<ErrorMessage> j = entryErrorList.iterator(); j.hasNext(); ) {
ErrorMessage em = j.next();
if (messageKey.equals(em.getErrorKey())) {
foundMessage = em;
}
}
}
}
return (foundMessage != null);
}
开发者ID:aapotts,项目名称:kuali_rice,代码行数:23,代码来源:MessageMap.java
示例14: getErrorMessagesForProperty
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* Gets a list of lists that represent errors that matched by the
* propertyName passed in (multiple lists because the wildcard can match
* multiple keys). If wildcard is true, the propertyName ends with a
* wildcard character. Otherwise, it will only match on the single key and
* return a list with one list
*
* @param propertyName
* @param allowWildcard
* @return
*/
public List<AutoPopulatingList<ErrorMessage>> getErrorMessagesForProperty(String propertyName,
boolean allowWildcard) {
List<AutoPopulatingList<ErrorMessage>> foundMessages = new ArrayList<AutoPopulatingList<ErrorMessage>>();
if (allowWildcard) {
boolean wildcard = false;
if (propertyName.endsWith("*")) {
wildcard = true;
propertyName = propertyName.substring(0, propertyName.length() - 1);
}
for (Iterator<String> keys = errorMessages.keySet().iterator(); keys.hasNext(); ) {
String key = keys.next();
if (!wildcard && propertyName.equals(key)) {
foundMessages.add(errorMessages.get(key));
break;
} else if (wildcard && key.startsWith(propertyName)) {
foundMessages.add(errorMessages.get(key));
}
}
} else {
foundMessages.add(getErrorMessagesForProperty(propertyName));
}
return foundMessages;
}
开发者ID:aapotts,项目名称:kuali_rice,代码行数:36,代码来源:MessageMap.java
示例15: getWarningMessagesForProperty
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* Gets a list of lists that represent warnings that matched by the
* propertyName passed in (multiple lists because the wildcard can match
* multiple keys). If wildcard is true, the propertyName ends with a
* wildcard character. Otherwise, it will only match on the single key and
* return a list with one list.
*
* @param propertyName
* @param allowWildcard
* @return
*/
public List<AutoPopulatingList<ErrorMessage>> getWarningMessagesForProperty(String propertyName,
boolean allowWildcard) {
List<AutoPopulatingList<ErrorMessage>> foundMessages = new ArrayList<AutoPopulatingList<ErrorMessage>>();
if (allowWildcard) {
boolean wildcard = false;
if (propertyName.endsWith("*")) {
wildcard = true;
propertyName = propertyName.substring(0, propertyName.length() - 1);
}
for (Iterator<String> keys = warningMessages.keySet().iterator(); keys.hasNext(); ) {
String key = keys.next();
if (!wildcard && propertyName.equals(key)) {
foundMessages.add(warningMessages.get(key));
break;
} else if (wildcard && key.startsWith(propertyName)) {
foundMessages.add(warningMessages.get(key));
}
}
} else {
foundMessages.add(getWarningMessagesForProperty(propertyName));
}
return foundMessages;
}
开发者ID:aapotts,项目名称:kuali_rice,代码行数:36,代码来源:MessageMap.java
示例16: getInfoMessagesForProperty
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* Gets a list of lists that represent info messages that matched by the
* propertyName passed in (multiple lists because the wildcard can match
* multiple keys). If wildcard is true, the propertyName ends with a
* wildcard character. If it is false, it will only match on the single key
* and return a list with one list.
*
* @param propertyName
* @param allowWildcard
* @return
*/
public List<AutoPopulatingList<ErrorMessage>> getInfoMessagesForProperty(String propertyName,
boolean allowWildcard) {
List<AutoPopulatingList<ErrorMessage>> foundMessages = new ArrayList<AutoPopulatingList<ErrorMessage>>();
if (allowWildcard) {
boolean wildcard = false;
if (propertyName.endsWith("*")) {
wildcard = true;
propertyName = propertyName.substring(0, propertyName.length() - 1);
}
for (Iterator<String> keys = infoMessages.keySet().iterator(); keys.hasNext(); ) {
String key = keys.next();
if (!wildcard && propertyName.equals(key)) {
foundMessages.add(infoMessages.get(key));
break;
} else if (wildcard && key.startsWith(propertyName)) {
foundMessages.add(infoMessages.get(key));
}
}
} else {
foundMessages.add(getInfoMessagesForProperty(propertyName));
}
return foundMessages;
}
开发者ID:aapotts,项目名称:kuali_rice,代码行数:36,代码来源:MessageMap.java
示例17: testMessageParameters
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* Test message parameters are being correctly added and associated with an error message.
*/
@Test public void testMessageParameters() {
MessageMap testMap = new MessageMap();
testMap.putError("accountNbr", RiceKeyConstants.ERROR_INACTIVE, "Account Number");
testMap.putError("accountNbr", RiceKeyConstants.ERROR_REQUIRED, "Account Number");
// check duplicate message doesn't get added
testMap.putError("accountNbr", RiceKeyConstants.ERROR_INACTIVE, "Account Number");
testMap.putError("chartCode", RiceKeyConstants.ERROR_REQUIRED, "Chart Code");
assertEquals(3, testMap.getErrorCount());
AutoPopulatingList errorMessages = testMap.getMessages("accountNbr");
assertEquals(2, errorMessages.size());
checkMessageParemeters(errorMessages, 0, RiceKeyConstants.ERROR_INACTIVE, new String[] { "Account Number" });
checkMessageParemeters(errorMessages, 1, RiceKeyConstants.ERROR_REQUIRED, new String[] { "Account Number" });
errorMessages = testMap.getMessages("chartCode");
assertEquals(1, errorMessages.size());
checkMessageParemeters(errorMessages, 0, RiceKeyConstants.ERROR_REQUIRED, new String[] { "Chart Code" });
}
开发者ID:aapotts,项目名称:kuali_rice,代码行数:24,代码来源:MessageMapTest.java
示例18: MessageMap
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
public MessageMap() {
errorPath = Collections.synchronizedList(new ArrayList<String>());
errorMessages = Collections.synchronizedMap(new LinkedHashMap<String, List<ErrorMessage>>());
warningMessages = Collections.synchronizedMap(new LinkedHashMap<String, List<ErrorMessage>>());
infoMessages = Collections.synchronizedMap(new LinkedHashMap<String, List<ErrorMessage>>());
growlMessages = Collections.synchronizedList(new AutoPopulatingList<GrowlMessage>(GrowlMessage.class));
}
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:MessageMap.java
示例19: KualiDocumentFormBase
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
/**
* no args constructor that just initializes things for us
*/
@SuppressWarnings("unchecked")
public KualiDocumentFormBase() {
super();
instantiateDocument();
newNote = new Note();
this.editingMode = new HashMap();
//this.additionalScriptFiles = new AutoPopulatingList(String.class);
this.additionalScriptFiles = new AutoPopulatingList<String>(String.class);
// set the initial record for persons up
newAdHocRoutePerson = new AdHocRoutePerson();
// set the initial record for workgroups up
newAdHocRouteWorkgroup = new AdHocRouteWorkgroup();
// to make sure it posts back the correct time
setFormatterType("document.documentHeader.note.finDocNotePostedDttmStamp", TimestampAMPMFormatter.class);
setFormatterType("document.documentHeader.note.attachment.finDocNotePostedDttmStamp", TimestampAMPMFormatter.class);
//TODO: Chris - Notes: remove the above and change the below from boNotes when notes are finished
//overriding note formatter to make sure they post back the full timestamp
setFormatterType("document.documentHeader.boNote.notePostedTimestamp",TimestampAMPMFormatter.class);
setFormatterType("document.documentBusinessObject.boNote.notePostedTimestamp",TimestampAMPMFormatter.class);
setFormatterType("editingMode", NoOpStringFormatter.class);
setFormatterType("editableAccounts", NoOpStringFormatter.class);
setDocumentActions(new HashMap());
suppressAllButtons = false;
initializeHeaderNavigationTabs();
}
开发者ID:kuali,项目名称:kc-rice,代码行数:36,代码来源:KualiDocumentFormBase.java
示例20: setExtraButtons
import org.springframework.util.AutoPopulatingList; //导入依赖的package包/类
public void setExtraButtons(List<ExtraButton> extraButtons) {
if ( extraButtons instanceof AutoPopulatingList ) {
this.extraButtons = extraButtons;
} else {
this.extraButtons.clear();
this.extraButtons.addAll( extraButtons );
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:KualiForm.java
注:本文中的org.springframework.util.AutoPopulatingList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论