1. /*
  2. * Copyright 2002-2004 the original author or authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.springframework.transaction.interceptor;
  17. /**
  18. * Tag class. Its class means it has the opposite behaviour to the
  19. * RollbackRule superclass.
  20. * @author Rod Johnson
  21. * @since 09-Apr-2003
  22. * @version $Id: NoRollbackRuleAttribute.java,v 1.5 2004/03/18 02:46:05 trisberg Exp $
  23. */
  24. public class NoRollbackRuleAttribute extends RollbackRuleAttribute {
  25. /**
  26. * Constrct a new NoRollbackRule for the given throwable class.
  27. * @param clazz throwable class
  28. */
  29. public NoRollbackRuleAttribute(Class clazz) {
  30. super(clazz);
  31. }
  32. /**
  33. * Construct a new NoRollbackRule for the given exception name.
  34. * This can be a substring, with no wildcard support at present.
  35. * A value of "ServletException" would match ServletException and
  36. * subclasses, for example.
  37. * @param exceptionName the exception pattern
  38. */
  39. public NoRollbackRuleAttribute(String exceptionName) {
  40. super(exceptionName);
  41. }
  42. public String toString() {
  43. return "No" + super.toString();
  44. }
  45. }