View Javadoc
1   /*
2    * Copyright 2007 Joachim Grueneis
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.exolab.castor.xml.util;
17  
18  import java.util.Map;
19  
20  import org.exolab.castor.xml.ResolverException;
21  
22  /**
23   * A command used by a resolver strategy to get class descriptors. A command
24   * may return none, a single class descriptor or multiple class descriptors and even
25   * if class descriptors are returned, is not garanteed that the requested descriptor
26   * is within. No exceptions are thrown if the class could not be resolved - this is
27   * a possible result!
28   * Commands are planned to be something like a service which might get invoked
29   * multiple times in parallel. So no resolve specific states are allowed to be
30   * stored in the class state!
31   * 
32   * @author <a href="mailto:jgrueneis AT gmail DOT com">Joachim Grueneis</a>
33   * @version $Revision$ $Date$
34   * @since 1.2
35   */
36  public interface ResolverClassCommand {
37  	/**
38  	 * The one and only purpose resolver commands are good for ;-) . It can
39       * be called with className and clazz set, so the command decides which
40       * suites it best or at least one of the two arguments set.
41       * 
42       * @param className the name of the class to resolve
43       * @param p the Properties to be used at resolve
44       * @return a Map of className and XMLClassDescriptor
45       * @throws IllegalArgumentException if both parameters are null
46       * @throws ResolverException in case that resolving fails fatally
47  	 */
48  	public Map resolve(String className, Map p)
49      throws ResolverException;
50  }