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 summary
Constructors -
Method summary
Modifier and TypeMethodDescriptionboolean inthashCode() booleanisCandidateClass(Class<?> targetClass) Determine whether the given class is a candidate for transaction attributes in the annotation format of thisTransactionAnnotationParser.parseTransactionAnnotation(jakarta.transaction.Transactional ann) parseTransactionAnnotation(AnnotatedElement element) Parse the transaction attribute for the given method or class, based on an annotation type understood by this parser.protected TransactionAttributeparseTransactionAnnotation(AnnotationAttributes attributes)
-
Constructor Details
-
JtaTransactionAnnotationParser
public JtaTransactionAnnotationParser()
-
-
Method Details
-
isCandidateClass
Description copied from interface: TransactionAnnotationParserDetermine whether the given class is a candidate for transaction attributes in the annotation format of thisTransactionAnnotationParser.If this method returns
false, the methods on the given class will not get traversed for#parseTransactionAnnotationintrospection. Returningfalseis therefore an optimization for non-affected classes, whereastruesimply means that the class needs to get fully introspected for each method on the given class individually.- specified by:
isCandidateClass in interface TransactionAnnotationParser- Parameters:
targetClass- the class to introspect- Returns:
falseif the class is known to have no transaction annotations at class or method level;trueotherwise. The default implementation returnstrue, leading to regular introspection.
-
parseTransactionAnnotation
public @Nullable TransactionAttribute parseTransactionAnnotation(AnnotatedElement element) Description copied from interface: TransactionAnnotationParserParse 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
nullif the method/class is not transactional.The returned attribute will typically (but not necessarily) be of type
RuleBasedTransactionAttribute.- specified by:
parseTransactionAnnotation in interface TransactionAnnotationParser- Parameters:
element- the annotated method or class- Returns:
- the configured transaction attribute, or
nullif none found - see Also:
-
parseTransactionAnnotation
public TransactionAttribute parseTransactionAnnotation(jakarta.transaction.Transactional ann) -
parseTransactionAnnotation
protected TransactionAttribute parseTransactionAnnotation(AnnotationAttributes attributes) -
equals
-
hashCode
-