Japan will end official development assistance to the world's second largest economy China after 40 years.