01: package com.bm.ejb3metadata.annotations.impl;
02:
03: import java.util.ArrayList;
04: import java.util.List;
05:
06: /**
07: * List of interfaces.
08: * @author Daniel Wiese
09: */
10: public abstract class JInterface {
11:
12: /**
13: * List of interfaces.
14: */
15: private List<String> interfaces = null;
16:
17: /**
18: * Constructor.
19: */
20: public JInterface() {
21: interfaces = new ArrayList<String>();
22: }
23:
24: /**
25: * Add an interface.
26: * @param itf name of the interface (asm)
27: */
28: public void addInterface(final String itf) {
29: interfaces.add(itf);
30: }
31:
32: /**
33: * @return list of interfaces.
34: */
35: public List<String> getInterfaces() {
36: return interfaces;
37: }
38:
39: /**
40: * @param itf the name of an encoded interface.
41: * @return true if the interface is already in the list.
42: */
43: public boolean contains(final String itf) {
44: return interfaces.contains(itf);
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(interfaces);
59: return sb.toString();
60: }
61: }
|