01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@ow2.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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: RemoveMethod.java 2059 2007-11-22 17:22:33Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.ow2.easybeans.deployment.xml.struct;
25:
26: import org.ow2.easybeans.deployment.xml.struct.common.MethodDD;
27:
28: /**
29: * This class manages the <remove-method> element of the xml DD.
30: * @author Florent Benoit
31: */
32: public class RemoveMethod {
33:
34: /**
35: * Name of this element.
36: */
37: public static final String NAME = "remove-method";
38:
39: /**
40: * This remove method is linked to a Method of the Bean (with params).
41: */
42: private MethodDD method = null;
43:
44: /**
45: * boolean used to know if when there is an exception, the bean should be kept or not.
46: * It uses a boolean object to know if the element has been set or not
47: */
48: private Boolean retainIfException = null;
49:
50: /**
51: * Sets the method of the bean which needs to be marked.
52: * @param method the method to use
53: */
54: public void setMethod(final MethodDD method) {
55: this .method = method;
56: }
57:
58: /**
59: * @return the method that will be used as a remove method
60: */
61: public MethodDD getMethod() {
62: return method;
63: }
64:
65: /**
66: * If there is an exception, the bean should be kept or not.
67: * @param retainIfException true to keep, or false to remove
68: */
69: public void setRetainIfException(final boolean retainIfException) {
70: this .retainIfException = Boolean.valueOf(retainIfException);
71: }
72:
73: /**
74: * @return the flag to know if when there is an exception, the bean should be kept or not.
75: * It returns null if it was not set.
76: */
77: public Boolean getRetainIfException() {
78: return retainIfException;
79: }
80:
81: }
|