001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: JActivationConfigProperty.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.deployment.annotations.impl;
025:
026: import java.lang.annotation.Annotation;
027:
028: import javax.ejb.ActivationConfigProperty;
029:
030: /**
031: * Acts as an implementation of @{@link javax.ejb.ActivationConfigProperty} annotation.
032: * @author Florent Benoit
033: */
034: public class JActivationConfigProperty implements
035: ActivationConfigProperty {
036:
037: /**
038: * Name.
039: */
040: private String name = null;
041:
042: /**
043: * Value.
044: */
045: private String value = null;
046:
047: /**
048: * Constructor.<br>
049: * Build an object with a given name and a given value.
050: * @param name given name
051: * @param value given value
052: */
053: public JActivationConfigProperty(final String name,
054: final String value) {
055: this .name = name;
056: this .value = value;
057: }
058:
059: /**
060: * @return property name
061: */
062: public String propertyName() {
063: return name;
064: }
065:
066: /**
067: * @return property value
068: */
069: public String propertyValue() {
070: return value;
071: }
072:
073: /**
074: * @return annotation type
075: */
076: public Class<? extends Annotation> annotationType() {
077: return ActivationConfigProperty.class;
078: }
079:
080: /**
081: * @return string representation
082: */
083: @Override
084: public String toString() {
085: StringBuilder sb = new StringBuilder();
086: // classname
087: sb.append(this .getClass().getName().substring(
088: this .getClass().getPackage().getName().length() + 1));
089: // property name
090: sb.append("[propertyName=");
091: sb.append(name);
092:
093: // property value
094: sb.append(", propertyValue=");
095: sb.append(value);
096:
097: sb.append("]");
098: return sb.toString();
099: }
100: }
|