Example usage for org.springframework.util AutoPopulatingList iterator

List of usage examples for org.springframework.util AutoPopulatingList iterator

Introduction

In this page you can find the example usage for org.springframework.util AutoPopulatingList iterator.

Prototype

@Override
    public Iterator<E> iterator() 

Source Link

Usage

From source file:org.kuali.ext.mm.integration.kfs.adaptor.impl.KfsDocumentServiceImpl.java

@SuppressWarnings({ "unchecked", "deprecation" })
protected String errors() {
    StringBuffer logMessage = new StringBuffer();
    //TODO : NWU - Confirm the same behaviour
    if (!GlobalVariables.getMessageMap().getErrorMessages().isEmpty()) {
        for (Iterator i = GlobalVariables.getMessageMap().getErrorMessages().entrySet().iterator(); i
                .hasNext();) {/*from w  ww  .  ja  va 2s. co m*/
            Map.Entry e = (Map.Entry) i.next();
            logMessage.append("[" + e.getKey() + "] ");
            boolean first = true;
            AutoPopulatingList errorList = (AutoPopulatingList) e.getValue();
            for (Iterator j = errorList.iterator(); j.hasNext();) {
                ErrorMessage em = (ErrorMessage) j.next();
                if (first) {
                    first = false;
                } else {
                    logMessage.append(";");
                }
                logMessage.append(em);
            }
        }
    }
    return logMessage.toString();
}

From source file:org.kuali.coeus.common.budget.impl.struts.BudgetSummaryAction.java

/**
 * //from  ww w  . java 2  s . c  o m
 * This method is to check the error map to see if there is any error other than line item date error.
 * line item date date error should be resolved with adjustlineitem start/end date.
 * This is called after rule verification and before save.
 * @return
 */
private boolean isLineItemErrorOnly() {
    if (!GlobalVariables.getMessageMap().hasNoErrors()) {

        for (Iterator i = GlobalVariables.getMessageMap().getErrorMessages().entrySet().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.getErrorKey().equals("error.lineItem.dateDoesNotmatch")) {
                    return false;
                }
            }
        }
    }
    return true;
}

From source file:org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase.java

/**
 * This method is used during debugging to dump the contents of the error map, including the key names. It is not
 * used by the/*from  w w  w  .j a  v  a 2s  .c  o m*/
 * 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());
            }
        }
    }
}

From source file:org.kuali.rice.krad.rules.MaintenanceDocumentRuleBase.java

/**
 * This method is used during debugging to dump the contents of the error map, including the key names. It is not
 * used by the//from   ww  w.  ja va  2  s  . c  om
 * 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());
            }
        }
    }
}