| BaseModelExtensionHandler.java |
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.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.model.BaseModel;
20 import com.liferay.portal.model.BaseModelExtension;
21
22 import java.util.List;
23
24 /**
25 * <a href="BaseModelExtensionHandler.java.html"><b><i>View Source</i></b></a>
26 *
27 * @author Raymond Aug�
28 * @deprecated
29 */
30 public class BaseModelExtensionHandler<T>
31 extends AbstractModelExtensionHandler<T> {
32
33 public Object extendSingle(BaseModel<T> model) {
34 if (model instanceof BaseModelExtension<?>) {
35 return model;
36 }
37 else {
38 BaseModelExtension<T> extension = getBaseModelExtension().extend(
39 model);
40
41 if (_log.isDebugEnabled()) {
42 StringBuilder sb = new StringBuilder();
43
44 sb.append("Extending ");
45 sb.append(model.getClass().getName());
46 sb.append(" to ");
47 sb.append(extension.getClass().getName());
48
49 _log.debug(sb.toString());
50 }
51
52 return extension;
53 }
54 }
55
56 public Object extendList(List<BaseModel<T>> models) {
57 return new WrappedList(models);
58 }
59
60 private static final Log _log =
61 LogFactoryUtil.getLog(BaseModelExtensionHandler.class);
62
63 }