View Javadoc

1   /*
2    * Copyright 2006-2011 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5    * 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 is distributed on
10   * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11   * specific language governing permissions and limitations under the License.
12   */
13  
14  
15  package org.springframework.security.oauth.examples.tonr.converter;
16  
17  import java.util.Arrays;
18  import java.util.HashSet;
19  import java.util.Set;
20  
21  import org.springframework.core.convert.TypeDescriptor;
22  import org.springframework.core.convert.converter.GenericConverter;
23  import org.springframework.security.oauth2.client.token.AccessTokenRequest;
24  
25  /**
26   * @author Dave Syer
27   * 
28   */
29  public class AccessTokenRequestConverter implements GenericConverter {
30  
31  	private Set<ConvertiblePair> convertibleTypes = new HashSet<GenericConverter.ConvertiblePair>(
32  			Arrays.asList(new ConvertiblePair(AccessTokenRequest.class, AccessTokenRequest.class)));
33  
34  	public Set<ConvertiblePair> getConvertibleTypes() {
35  		return convertibleTypes;
36  	}
37  
38  	public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
39  		return source;
40  	}
41  
42  }