View Javadoc

1   /*
2    * Licensed under the Apache License, Version 2.0 (the "License");
3    * you may not use this file except in compliance with the License.
4    * You may obtain a copy of the License at
5    *
6    *      http://www.apache.org/licenses/LICENSE-2.0
7    *
8    * Unless required by applicable law or agreed to in writing, software
9    * distributed under the License is distributed on an "AS IS" BASIS,
10   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11   * See the License for the specific language governing permissions and
12   * limitations under the License.
13   */
14  package org.apache.commons.classscan;
15  
16  import java.util.Collection;
17  
18  import org.apache.commons.classscan.model.MetaClass;
19  
20  /**
21   * Information about a code location. A code location may be a file folder, or a
22   * jar, or other packaged location
23   */
24  public interface MetaClassPathElement extends HasName {
25      /**
26       * Get metadata about the Classes which are available in the code location.
27       * 
28       * @return A read-only collection of class information
29       */
30      Collection<? extends MetaClass> getMetaClasses();
31  
32      /**
33       * Get metadata about a Class which is available in the code location.
34       * 
35       * @param className
36       *            The canonical className of the desired Class
37       * @return The class information; or null, if class of given name not
38       *         available at this location
39       */
40      MetaClass getMetaClass(String className);
41  
42      /**
43       * Get the name of the location of the jar or folder.  This name can be used as the parameter
44       * to the {@link java.net.URI URI} or {@link java.net.URL URL} constructor.
45       */
46      String getName();
47  }