Here you can find the source of putClassToMap(String extensionId, String key, Class> className)
private static void putClassToMap(String extensionId, String key, Class<?> className)
//package com.java2s; /**/*from ww w . j av a 2 s . co m*/ * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE) * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Main { private static Map<String, Map<String, List<Class<?>>>> extensionClassMap; private static void putClassToMap(String extensionId, String key, Class<?> className) { Map<String, List<Class<?>>> map; if (!extensionClassMap.containsKey(extensionId)) { map = new HashMap<String, List<Class<?>>>(); extensionClassMap.put(extensionId, map); } else { map = extensionClassMap.get(extensionId); } List<Class<?>> classList; if (map.containsKey(key)) { classList = map.get(key); } else { classList = new ArrayList<Class<?>>(); map.put(key, classList); } classList.add(className); } }