1 /*
2 * Copyright 2004-2008 the Seasar Foundation and the Others.
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,
13 * either express or implied. See the License for the specific language
14 * governing permissions and limitations under the License.
15 */
16 package org.seasar.cubby.customizer;
17
18 import org.seasar.cubby.aop.ActionMethodPointcutImpl;
19 import org.seasar.framework.aop.Pointcut;
20 import org.seasar.framework.util.StringUtil;
21
22 /**
23 * {@link org.seasar.framework.aop.Pointcut ポイントカット}を構築するためのファクトリクラスです。
24 *
25 * @author baba
26 */
27 class PointcutFactory {
28
29 /**
30 * 指定されたポイントカットを表す文字列から、 {@link org.seasar.framework.aop.Pointcut ポイントカット}を構築して返します。
31 *
32 * @param pointcutStr
33 * ポイントカットを表す文字列
34 * @return ポイントカット
35 */
36 public static Pointcut createPointcut(final String pointcutStr) {
37 if (!StringUtil.isEmpty(pointcutStr)) {
38 String[] methodNames = StringUtil.split(pointcutStr, ", \n");
39 return new ActionMethodPointcutImpl(methodNames);
40 }
41 return null;
42 }
43
44 /**
45 * 指定された{@link Class クラス}から、
46 * {@link org.seasar.framework.aop.Pointcut ポイントカット}を構築して返します。
47 *
48 * @param clazz
49 * クラス
50 * @return ポイントカット
51 */
52 public static Pointcut createPointcut(final Class<?> clazz) {
53 return new ActionMethodPointcutImpl(clazz);
54 }
55
56 }