01: package com.bm.ejb3metadata.annotations.impl;
02:
03: import java.util.ArrayList;
04: import java.util.List;
05:
06: /**
07: * List of interceptor classes.
08: * @author Daniel Wiese
09: */
10: public class JInterceptors {
11:
12: /**
13: * List of classes.
14: */
15: private List<String> classes = null;
16:
17: /**
18: * Constructor.
19: */
20: public JInterceptors() {
21: classes = new ArrayList<String>();
22: }
23:
24: /**
25: * Add a class.
26: * @param cls name of the class (asm)
27: */
28: public void addClass(final String cls) {
29: classes.add(cls);
30: }
31:
32: /**
33: * @return list of classes.
34: */
35: public List<String> getClasses() {
36: return classes;
37: }
38:
39: /**
40: * @param cls the name of an encoded class.
41: * @return true if the class is already in the list.
42: */
43: public boolean contains(final String cls) {
44: return classes.contains(cls);
45: }
46:
47: /**
48: * @return string representation
49: */
50: @Override
51: public String toString() {
52: StringBuilder sb = new StringBuilder();
53: // classname
54: sb.append(this .getClass().getName().substring(
55: this .getClass().getPackage().getName().length() + 1));
56:
57: // list
58: sb.append(classes);
59: return sb.toString();
60: }
61:
62: }
|