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 java.util.Collection; 017 018 import org.apache.commons.classscan.model.MetaClass; 019 020 /** 021 * Information about a code location. A code location may be a file folder, or a 022 * jar, or other packaged location 023 */ 024 public interface MetaClassPathElement extends HasName { 025 /** 026 * Get metadata about the Classes which are available in the code location. 027 * 028 * @return A read-only collection of class information 029 */ 030 Collection<? extends MetaClass> getMetaClasses(); 031 032 /** 033 * Get metadata about a Class which is available in the code location. 034 * 035 * @param className 036 * The canonical className of the desired Class 037 * @return The class information; or null, if class of given name not 038 * available at this location 039 */ 040 MetaClass getMetaClass(String className); 041 042 /** 043 * Get the name of the location of the jar or folder. This name can be used as the parameter 044 * to the {@link java.net.URI URI} or {@link java.net.URL URL} constructor. 045 */ 046 String getName(); 047 }