01: package com.bm.ejb3metadata.annotations.impl;
02:
03: import java.lang.annotation.Annotation;
04:
05: import javax.ejb.ActivationConfigProperty;
06:
07: /**
08: * Acts as an implementation of @{@link javax.ejb.ActivationConfigProperty} annotation.
09: * @author Daniel Wiese
10: */
11: public class JActivationConfigProperty implements
12: ActivationConfigProperty {
13:
14: /**
15: * Name.
16: */
17: private String name = null;
18:
19: /**
20: * Value.
21: */
22: private String value = null;
23:
24: /**
25: * Constructor.<br>
26: * Build an object with a given name and a given value.
27: * @param name given name
28: * @param value given value
29: */
30: public JActivationConfigProperty(final String name,
31: final String value) {
32: this .name = name;
33: this .value = value;
34: }
35:
36: /**
37: * @return property name
38: */
39: public String propertyName() {
40: return name;
41: }
42:
43: /**
44: * @return property value
45: */
46: public String propertyValue() {
47: return value;
48: }
49:
50: /**
51: * @return annotation type
52: */
53: public Class<? extends Annotation> annotationType() {
54: return ActivationConfigProperty.class;
55: }
56:
57: /**
58: * @return string representation
59: */
60: @Override
61: public String toString() {
62: StringBuilder sb = new StringBuilder();
63: // classname
64: sb.append(this .getClass().getName().substring(
65: this .getClass().getPackage().getName().length() + 1));
66: // property name
67: sb.append("[propertyName=");
68: sb.append(name);
69:
70: // property value
71: sb.append(", propertyValue=");
72: sb.append(value);
73:
74: sb.append("]");
75: return sb.toString();
76: }
77: }
|