KickJava   Java API By Example, From Geeks To Geeks.

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


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: JActivationConfigProperty.java 9 2006-02-19 18:53:32Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.deployment.annotations.impl;
27
28 import java.lang.annotation.Annotation JavaDoc;
29
30 import javax.ejb.ActivationConfigProperty JavaDoc;
31
32 /**
33  * Acts as an implementation of @{@link javax.ejb.ActivationConfigProperty} annotation.
34  * @author Florent Benoit
35  */

36 public class JActivationConfigProperty implements ActivationConfigProperty JavaDoc {
37
38     /**
39      * Name.
40      */

41     private String JavaDoc name = null;
42
43     /**
44      * Value.
45      */

46     private String JavaDoc value = null;
47
48     /**
49      * Constructor.<br>
50      * Build an object with a given name and a given value.
51      * @param name given name
52      * @param value given value
53      */

54     public JActivationConfigProperty(final String JavaDoc name, final String JavaDoc value) {
55         this.name = name;
56         this.value = value;
57     }
58
59
60     /**
61      * @return property name
62      */

63     public String JavaDoc propertyName() {
64         return name;
65     }
66
67     /**
68      * @return property value
69      */

70     public String JavaDoc propertyValue() {
71         return value;
72     }
73
74     /**
75      * @return annotation type
76      */

77     public Class JavaDoc<? extends Annotation JavaDoc> annotationType() {
78         return ActivationConfigProperty JavaDoc.class;
79     }
80
81     /**
82      * @return string representation
83      */

84     @Override JavaDoc
85     public String JavaDoc toString() {
86         StringBuilder JavaDoc sb = new StringBuilder JavaDoc();
87         // classname
88
sb.append(this.getClass().getName().substring(this.getClass().getPackage().getName().length() + 1));
89         // property name
90
sb.append("[propertyName=");
91         sb.append(name);
92
93         // property value
94
sb.append(", propertyValue=");
95         sb.append(value);
96
97         sb.append("]");
98         return sb.toString();
99     }
100 }
101
Popular Tags