001 /*
002 * Licensed under the Apache License, Version 2.0 (the "License");
003 * you may not use this file except in compliance with the License.
004 * You may obtain a copy of the License at
005 *
006 * http://www.apache.org/licenses/LICENSE-2.0
007 *
008 * Unless required by applicable law or agreed to in writing, software
009 * distributed under the License is distributed on an "AS IS" BASIS,
010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
011 * See the License for the specific language governing permissions and
012 * limitations under the License.
013 */
014 package org.apache.commons.classscan;
015
016 import org.apache.commons.classscan.builtin.DefaultMetaRegistry;
017
018 /**
019 * The entry point from which to find information about the ClassPath and the classes
020 * available from the ClassPath.
021 */
022 public interface MetaRegistry {
023
024 public static final MetaRegistry DEFAULT_REGISTRY = new DefaultMetaRegistry();
025
026 /**
027 * Get the MetaClassLoader for a ClassLoader. If possible, an existing
028 * MetaClassLoader is returned. Otherwise, the MetaClassLoader is created.
029 *
030 * @param classLoader
031 * The ClassLoader for which metadata is desired (may be be null,
032 * for the bootstrap ClassLoader)
033 * @return The metadata about a ClassLoader
034 */
035 MetaClassLoader getMetaClassLoader(ClassLoader classLoader);
036
037 /**
038 * Get the ClassPath for a ClassLoader
039 *
040 * @param classLoader
041 * The ClassLoader for which metadata is desired (may be be null,
042 * for the bootstrap ClassLoader)
043 * @return The ClassPath for the ClassLoader
044 */
045 ClassPath getClassPath(ClassLoader classLoader);
046 }