View Javadoc
1   /*
2    * Copyright 2007 Joachim Grueneis
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5    * in compliance with the License. You may obtain a copy of the License at
6    *
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software distributed under the License
10   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11   * or implied. See the License for the specific language governing permissions and limitations under
12   * the License.
13   */
14  package org.exolab.castor.xml.util;
15  
16  import java.util.Map;
17  
18  import org.exolab.castor.xml.ResolverException;
19  
20  /**
21   * A command used by a resolver strategy to get class descriptors for a package. The number of class
22   * descriptors returned will vary between zero and many... Commands are planned to be something like
23   * a service which might get invoked multiple times in parallel. So no resolve specific states are
24   * allowed to be stored in the class state!
25   * 
26   * @author <a href="mailto:jgrueneis AT gmail DOT com">Joachim Grueneis</a>
27   * @version $Revision$ $Date$
28   * @since 1.2
29   */
30  public interface ResolverPackageCommand {
31    /**
32     * The one and only purpose resolver commands are good for ;-) . Resolving the package giving and
33     * returning (a maybe empty) list of descriptors found. The descriptors are put into a Map of
34     * String (className) and Class (descriptor class).
35     * 
36     * @param packageName the name of the package to resolve
37     * @param p the Properties to be used at resolve
38     * @return a Map of className and XMLClassDescriptor
39     * @throws IllegalArgumentException if package name is null or empty
40     * @throws ResolverException in case that resolving fails fatally
41     */
42    public Map resolve(String packageName, Map p) throws ResolverException;
43  }