KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > deployment > annotations > impl > JInterceptors


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: JInterceptors.java 503 2006-05-24 13:44:31Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.deployment.annotations.impl;
27
28 import java.util.ArrayList JavaDoc;
29 import java.util.List JavaDoc;
30
31
32 /**
33  * List of interceptor classes.
34  * @author Florent Benoit
35  */

36 public class JInterceptors {
37
38     /**
39      * List of classes.
40      */

41     private List JavaDoc<String JavaDoc> classes = null;
42
43     /**
44      * Constructor.
45      */

46     public JInterceptors() {
47         classes = new ArrayList JavaDoc<String JavaDoc>();
48     }
49
50     /**
51      * Add a class.
52      * @param cls name of the class (asm)
53      */

54     public void addClass(final String JavaDoc cls) {
55         classes.add(cls);
56     }
57
58     /**
59      * @return list of classes.
60      */

61     public List JavaDoc<String JavaDoc> getClasses() {
62         return classes;
63     }
64
65     /**
66      * @param cls the name of an encoded class.
67      * @return true if the class is already in the list.
68      */

69     public boolean contains(final String JavaDoc cls) {
70         return classes.contains(cls);
71     }
72
73     /**
74      * @return string representation
75      */

76     @Override JavaDoc
77     public String JavaDoc toString() {
78         StringBuilder JavaDoc sb = new StringBuilder JavaDoc();
79         // classname
80
sb.append(this.getClass().getName().substring(this.getClass().getPackage().getName().length() + 1));
81
82         // list
83
sb.append(classes);
84         return sb.toString();
85     }
86
87 }
88
Popular Tags