Package org.springframework.aop.aspectj.annotation

# Class AspectMetadata

java.lang.Object
org.springframework.aop.aspectj.annotation.AspectMetadata

All Implemented Interfaces:
  `Serializable`

public class AspectMetadata extends Object implements Serializable
Metadata for an AspectJ aspect class, with an additional Spring AOP pointcut for the per clause.

Uses AspectJ 5 AJType reflection API, enabling us to work with different AspectJ instantiation models such as "singleton", "pertarget" and "perthis".

Since:
  2.0
Author:
  Rod Johnson, Juergen Hoeller
See Also:
  - `AspectJExpressionPointcut`
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`AspectMetadata(Class<?> aspectClass, String aspectName)`
Create a new AspectMetadata instance for the given aspect class.

## Method Summary

Modifier and Type
Method
Description
`org.aspectj.lang.reflect.AjType<?>`
`getAjType()`
Return AspectJ reflection information.
`Class<?>`
`getAspectClass()`
Return the aspect class.
`String`
`getAspectName()`
Return the aspect name.
`Pointcut`
`getPerClausePointcut()`
Return a Spring pointcut expression for a singleton aspect.
`boolean`
`isLazilyInstantiated()`
Return whether the aspect needs to be lazily instantiated.
`boolean`
`isPerThisOrPerTarget()`
Return whether the aspect is defined as "perthis" or "pertarget".
`boolean`
`isPerTypeWithin()`
Return whether the aspect is defined as "pertypewithin".

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

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

## Constructor Details

### AspectMetadata

public AspectMetadata(Class<?> aspectClass, String aspectName)
Create a new AspectMetadata instance for the given aspect class.

Parameters:
  `aspectClass` - the aspect class
  `aspectName` - the name of the aspect

## Method Details

### getAjType

public org.aspectj.lang.reflect.AjType<?> getAjType()
Return AspectJ reflection information.

### getAspectClass

public Class<?> getAspectClass()
Return the aspect class.

### getAspectName

public String getAspectName()
Return the aspect name.

### getPerClausePointcut

public Pointcut getPerClausePointcut()
Return a Spring pointcut expression for a singleton aspect. (for example, `Pointcut.TRUE` if it's a singleton).

### isPerThisOrPerTarget

public boolean isPerThisOrPerTarget()
Return whether the aspect is defined as "perthis" or "pertarget".

### isPerTypeWithin

public boolean isPerTypeWithin()
Return whether the aspect is defined as "pertypewithin".

### isLazilyInstantiated

public boolean isLazilyInstantiated()
Return whether the aspect needs to be lazily instantiated.