Class SpringTransactionAnnotationParser
java.lang.Object
org.springframework.transaction.annotation.SpringTransactionAnnotationParser
- All Implemented Interfaces:
Serializable
,TransactionAnnotationParser
public class SpringTransactionAnnotationParser
extends Object
implements TransactionAnnotationParser, Serializable
Strategy implementation for parsing Spring's
Transactional
annotation.- Since:
- 2.5
- Author:
- Juergen Hoeller, Mark Paluch
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
boolean
isCandidateClass
(Class<?> targetClass) Determine whether the given class is a candidate for transaction attributes in the annotation format of thisTransactionAnnotationParser
.Parse the transaction attribute for the given method or class, based on an annotation type understood by this parser.protected TransactionAttribute
parseTransactionAnnotation
(AnnotationAttributes attributes)
-
Constructor Details
-
SpringTransactionAnnotationParser
public SpringTransactionAnnotationParser()
-
-
Method Details
-
isCandidateClass
Description copied from interface:TransactionAnnotationParser
Determine 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#parseTransactionAnnotation
introspection. Returningfalse
is therefore an optimization for non-affected classes, whereastrue
simply means that the class needs to get fully introspected for each method on the given class individually.- Specified by:
isCandidateClass
in interfaceTransactionAnnotationParser
- 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 returnstrue
, leading to regular introspection.
-
parseTransactionAnnotation
Description copied from interface: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.- Specified by:
parseTransactionAnnotation
in interfaceTransactionAnnotationParser
- Parameters:
element
- the annotated method or class- Returns:
- the configured transaction attribute, or
null
if none found - See Also:
-
parseTransactionAnnotation
-
parseTransactionAnnotation
-
equals
-
hashCode
public int hashCode()
-