View Javadoc

1   /*
2    * Copyright 2007 the original author or authors.
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  
17  package org.springframework.oxm;
18  
19  import java.lang.reflect.Method;
20  import java.lang.reflect.Type;
21  
22  /**
23   * Extension of the {@link Unmarshaller} interface that supports Java 5 generics. More specifically, this unmarshaller
24   * adds support for the new {@link Type} hierarchy, returned by methods such as {@link
25   * Method#getGenericParameterTypes()} and {@link Method#getGenericReturnType()}.
26   *
27   * @author Arjen Poutsma
28   * @since 1.0.2
29   */
30  public interface GenericUnmarshaller extends Unmarshaller {
31  
32      /**
33       * Indicates whether this unmarshaller can unmarshal instances of the supplied type.
34       *
35       * @param type the type that this unmarshaller is being asked if it can marshal
36       * @return <code>true</code> if this unmarshaller can indeed unmarshal to the supplied type; <code>false</code>
37       *         otherwise
38       */
39      boolean supports(Type type);
40  }