001 // Copyright 2005 The Apache Software Foundation
002 //
003 // Licensed under the Apache License, Version 2.0 (the "License");
004 // you may not use this file except in compliance with the License.
005 // You may obtain a copy of the License at
006 //
007 // http://www.apache.org/licenses/LICENSE-2.0
008 //
009 // Unless required by applicable law or agreed to in writing, software
010 // distributed under the License is distributed on an "AS IS" BASIS,
011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012 // See the License for the specific language governing permissions and
013 // limitations under the License.
014
015 package org.apache.tapestry.services;
016
017 /**
018 * Used to search for a class within a list of packages. Available as service tapestry.ClassFinder.
019 *
020 * @author Howard Lewis Ship
021 * @since 4.0
022 */
023 public interface ClassFinder
024 {
025 /**
026 * Searches for a class within a list of packages, which always includes the default package.
027 *
028 * @param packageList
029 * a comma seperated list of package names (i.e., "java.lang,java.util")
030 * @param className
031 * the name of the class to search for. This may be just a class name, or even a
032 * partial class name (i.e., "impl.Foo").
033 * @return the class, if found, or null if no class could be found in any of the packages
034 */
035
036 Class findClass(String packageList, String className);
037 }