Class JtaTransactionAnnotationParser

java.lang.Object
org.springframework.transaction.annotation.JtaTransactionAnnotationParser
All Implemented Interfaces:
serializable, TransactionAnnotationParser

public class JtaTransactionAnnotationParser extends Object implements TransactionAnnotationParser, serializable
strategy implementation for parsing JTA 1.2's Transactional annotation.
since:
4.0
Author:
Juergen Hoeller
see Also:
  • Constructor Details

    • JtaTransactionAnnotationParser

      public JtaTransactionAnnotationParser()
  • Method Details

    • isCandidateClass

      public&nbsp;boolean&nbsp;isCandidateClass(Class<?>&nbsp;targetClass)
      Description copied from interface:&nbsp;TransactionAnnotationParser
      Determine whether the given class is a candidate for transaction attributes in the annotation format of this TransactionAnnotationParser.

      If this method returns false, the methods on the given class will not get traversed for #parseTransactionAnnotation introspection. Returning false is therefore an optimization for non-affected classes, whereas true simply means that the class needs to get fully introspected for each method on the given class individually.

      specified by:
      isCandidateClass&nbsp;in interface&nbsp;TransactionAnnotationParser
      Parameters:
      targetClass - the class to introspect
      Returns:
      false if the class is known to have no transaction annotations at class or method level; true otherwise. The default implementation returns true, leading to regular introspection.
    • parseTransactionAnnotation

      public&nbsp;@Nullable TransactionAttribute&nbsp;parseTransactionAnnotation(AnnotatedElement&nbsp;element)
      Description copied from interface:&nbsp;TransactionAnnotationParser
      Parse the transaction attribute for the given method or class, based on an annotation type understood by this parser.

      This essentially parses a known transaction annotation into spring's metadata attribute class. Returns null if the method/class is not transactional.

      The returned attribute will typically (but not necessarily) be of type RuleBasedTransactionAttribute.

      specified by:
      parseTransactionAnnotation&nbsp;in interface&nbsp;TransactionAnnotationParser
      Parameters:
      element - the annotated method or class
      Returns:
      the configured transaction attribute, or null if none found
      see Also:
    • parseTransactionAnnotation

      public&nbsp;TransactionAttribute&nbsp;parseTransactionAnnotation(jakarta.transaction.Transactional&nbsp;ann)
    • parseTransactionAnnotation

      protected&nbsp;TransactionAttribute&nbsp;parseTransactionAnnotation(AnnotationAttributes&nbsp;attributes)
    • equals

      public&nbsp;boolean&nbsp;equals(@Nullable Object&nbsp;other)
      Overrides:
      equals&nbsp;in class&nbsp;Object
    • hashCode

      public&nbsp;int&nbsp;hashCode()
      Overrides:
      hashCode&nbsp;in class&nbsp;Object