public static void addErrors(List<String> targetList,Map<String,Object> targetMap,Map<String,? extends Object> callResult){
  List<String> newList;
  Map<String,Object> errorMsgMap;
  if (callResult.containsKey(ModelService.ERROR_MESSAGE)) {
    targetList.add((String)callResult.get(ModelService.ERROR_MESSAGE));
  }
  if (callResult.containsKey(ModelService.ERROR_MESSAGE_LIST)) {
    newList=UtilGenerics.checkList(callResult.get(ModelService.ERROR_MESSAGE_LIST));
    targetList.addAll(newList);
  }
  if (callResult.containsKey(ModelService.ERROR_MESSAGE_MAP)) {
    errorMsgMap=UtilGenerics.checkMap(callResult.get(ModelService.ERROR_MESSAGE_MAP));
    targetMap.putAll(errorMsgMap);
  }
}

public static void addErrors ( List < String > targetList , Map < String , Object > targetMap , Map < String , ? extends Object > callResult ) { List < String > newList ; Map < String , Object > errorMsgMap ; if ( callResult . containsKey ( ModelService . ERROR_MESSAGE ) ) { targetList . add ( ( String ) callResult . get ( ModelService . ERROR_MESSAGE ) ) ; } if ( callResult . containsKey ( ModelService . ERROR_MESSAGE_LIST ) ) { newList = UtilGenerics . checkList ( callResult . get ( ModelService . ERROR_MESSAGE_LIST ) ) ; targetList . addAll ( newList ) ; } if ( callResult . containsKey ( ModelService . ERROR_MESSAGE_MAP ) ) { errorMsgMap = UtilGenerics . checkMap ( callResult . get ( ModelService . ERROR_MESSAGE_MAP ) ) ; targetMap . putAll ( errorMsgMap ) ; } }
takes the result of an invocation and extracts any error messages and adds them to the targetlist or targetmap . this will handle both list and string error messags .
