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

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

Introduction

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

Prototype

PerClauseKind PERTHIS

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

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".
 *//*  w  ww  .  j a v a  2s . 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 testPerThisAspect() {
    AspectMetadata am = new AspectMetadata(PerThisAspect.class, "someBean");
    assertTrue(am.isPerThisOrPerTarget());
    assertNotSame(Pointcut.TRUE, am.getPerClausePointcut());
    assertEquals(PerClauseKind.PERTHIS, am.getAjType().getPerClause().getKind());
}