001: /**
002: *
003: * Licensed to the Apache Software Foundation (ASF) under one or more
004: * contributor license agreements. See the NOTICE file distributed with
005: * this work for additional information regarding copyright ownership.
006: * The ASF licenses this file to You under the Apache License, Version 2.0
007: * (the "License"); you may not use this file except in compliance with
008: * the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */package org.apache.openejb.jee;
018:
019: import javax.xml.bind.annotation.XmlAccessType;
020: import javax.xml.bind.annotation.XmlAccessorType;
021: import javax.xml.bind.annotation.XmlAttribute;
022: import javax.xml.bind.annotation.XmlElement;
023: import javax.xml.bind.annotation.XmlID;
024: import javax.xml.bind.annotation.XmlType;
025: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
026: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
027:
028: /**
029: */
030: @XmlAccessorType(XmlAccessType.FIELD)
031: @XmlType(name="remove-methodType",propOrder={"beanMethod","retainIfException"})
032: public class RemoveMethod {
033:
034: @XmlElement(name="bean-method",required=true)
035: protected NamedMethod beanMethod;
036: @XmlElement(name="retain-if-exception",required=true)
037: protected Boolean retainIfException;
038: @XmlAttribute
039: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
040: @XmlID
041: protected String id;
042:
043: public RemoveMethod() {
044: }
045:
046: public RemoveMethod(java.lang.reflect.Method beanMethod) {
047: this (beanMethod, false);
048: }
049:
050: public RemoveMethod(java.lang.reflect.Method beanMethod,
051: boolean retainIfException) {
052: this .beanMethod = new NamedMethod(beanMethod);
053: this .retainIfException = retainIfException;
054: }
055:
056: public NamedMethod getBeanMethod() {
057: return beanMethod;
058: }
059:
060: public void setBeanMethod(NamedMethod value) {
061: this .beanMethod = value;
062: }
063:
064: public boolean isExplicitlySet() {
065: return retainIfException != null;
066: }
067:
068: public boolean getRetainIfException() {
069: return retainIfException != null && retainIfException;
070: }
071:
072: public void setRetainIfException(boolean value) {
073: this .retainIfException = value;
074: }
075:
076: public String getId() {
077: return id;
078: }
079:
080: public void setId(String value) {
081: this .id = value;
082: }
083:
084: public boolean equals(Object o) {
085: if (this == o)
086: return true;
087: if (o == null || getClass() != o.getClass())
088: return false;
089:
090: final RemoveMethod that = (RemoveMethod) o;
091:
092: if (beanMethod != null ? !beanMethod.equals(that.beanMethod)
093: : that.beanMethod != null)
094: return false;
095:
096: return true;
097: }
098:
099: public int hashCode() {
100: return (beanMethod != null ? beanMethod.hashCode() : 0);
101: }
102: }
|