1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.spring.aop;
16  
17  import com.liferay.portal.model.BaseModel;
18  import com.liferay.portal.model.BaseModelExtension;
19  import com.liferay.portal.model.ModelExtensionHandler;
20  
21  import java.util.ArrayList;
22  import java.util.List;
23  
24  /**
25   * <a href="AbstractModelExtensionHandler.java.html"><b><i>View Source</i></b>
26   * </a>
27   *
28   * @author     Raymond Aug�
29   * @deprecated
30   */
31  public abstract class AbstractModelExtensionHandler<T>
32      implements ModelExtensionHandler<T> {
33  
34      public Object extendList(List<BaseModel<T>> models) {
35          return new WrappedList(models);
36      }
37  
38      public BaseModelExtension<T> getBaseModelExtension() {
39          return _baseModelExtension;
40      }
41  
42      public List<String> getExtensionMethodNames() {
43          return _extensionMethodNames;
44      }
45  
46      public void setBaseModelExtensionClass(
47          BaseModelExtension<T> baseModelExtension) {
48  
49          _baseModelExtension = baseModelExtension;
50      }
51  
52      public void setExtensionMethodNames(List<String> extensionMethodNames) {
53          _extensionMethodNames = extensionMethodNames;
54      }
55  
56      public class WrappedList extends ArrayList<BaseModel<T>> {
57  
58          public WrappedList(List<BaseModel<T>> models) {
59              super(models);
60          }
61  
62          public BaseModel<T> get(int index) {
63              return (BaseModel<T>)extendSingle(super.get(index));
64          }
65  
66      }
67  
68      private BaseModelExtension<T> _baseModelExtension;
69      private List<String> _extensionMethodNames;
70  
71  }