Example usage for org.aspectj.lang.reflect PerClauseKind PERTARGET

List of usage examples for org.aspectj.lang.reflect PerClauseKind PERTARGET

Introduction

In this page you can find the example usage for org.aspectj.lang.reflect PerClauseKind PERTARGET.

Prototype

PerClauseKind PERTARGET

To view the source code for org.aspectj.lang.reflect PerClauseKind PERTARGET.

Click Source Link

Usage

From source file:org.springframework.aop.aspectj.annotation.AspectMetadata.java

License:Apache License

/**
 * Return whether the aspect is defined as "perthis" or "pertarget".
 *//* ww  w .ja v  a2  s.c o  m*/
public boolean isPerThisOrPerTarget() {
    PerClauseKind kind = getAjType().getPerClause().getKind();
    return (kind == PerClauseKind.PERTARGET || kind == PerClauseKind.PERTHIS);
}

From source file:org.springframework.aop.aspectj.annotation.AspectMetadataTests.java

License:Apache License

@Test
public void testPerTargetAspect() {
    AspectMetadata am = new AspectMetadata(PerTargetAspect.class, "someBean");
    assertTrue(am.isPerThisOrPerTarget());
    assertNotSame(Pointcut.TRUE, am.getPerClausePointcut());
    assertEquals(PerClauseKind.PERTARGET, am.getAjType().getPerClause().getKind());
}