Package org.springframework.transaction.annotation

# 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:
  - `SpringTransactionAnnotationParser`
  - `Ejb3TransactionAnnotationParser`
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`JtaTransactionAnnotationParser()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object other)`
`int`
`hashCode()`
`boolean`
`isCandidateClass(Class<?> targetClass)`
Determine whether the given class is a candidate for transaction attributes in the annotation format of this `TransactionAnnotationParser`.
`TransactionAttribute`
`parseTransactionAnnotation(Transactional ann)`
`TransactionAttribute`
`parseTransactionAnnotation(AnnotatedElement element)`
Parse the transaction attribute for the given method or class, based on an annotation type understood by this parser.
`protected TransactionAttribute`
`parseTransactionAnnotation(org.springframework.core.annotation.AnnotationAttributes attributes)`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### JtaTransactionAnnotationParser

public JtaTransactionAnnotationParser()

## Method Details

### isCandidateClass

public boolean isCandidateClass(Class<?> targetClass)
Description copied from interface: `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` in interface `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

@Nullable public TransactionAttribute parseTransactionAnnotation(AnnotatedElement element)
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.

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 `null` if none found
See Also:
  - `AnnotationTransactionAttributeSource.determineTransactionAttribute(java.lang.reflect.AnnotatedElement)`

### parseTransactionAnnotation

public TransactionAttribute parseTransactionAnnotation(Transactional ann)

### parseTransactionAnnotation

protected TransactionAttribute parseTransactionAnnotation(org.springframework.core.annotation.AnnotationAttributes attributes)

### equals

public boolean equals(@Nullable Object other)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`