CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-org-aspectj--aspectjrt

The AspectJ runtime is a small library necessary to run Java programs enhanced by AspectJ aspects during a previous compile-time or post-compile-time (binary weaving) build step.

Pending
Overview
Eval results
Files

reflection-api.mddocs/

Reflection API

AspectJ-specific type system that extends Java reflection to provide access to aspect-oriented features like pointcuts, advice, inter-type declarations, and per-clauses. The reflection API enables runtime introspection of aspects and aspect-enhanced classes, supporting dynamic aspect discovery and programmatic access to aspect metadata.

Capabilities

AjType Interface

AspectJ representation of a type that provides access to AspectJ-specific type information.

/**
 * AspectJ representation of a type that provides access to AspectJ specific type information
 */
public interface AjType<T> {
    String getName();
    Class<T> getJavaClass();
    AjType<?>[] getInterfaces();
    boolean isAspect();
    Aspect getAspectAnnotation();
    PerClause getPerClause();
    Pointcut[] getPointcuts();
    Advice[] getAdvice();
    InterTypeMethodDeclaration[] getITDMethods();
    InterTypeFieldDeclaration[] getITDFields();
    InterTypeConstructorDeclaration[] getITDConstructors();
}

AjTypeSystem

Provides access to the AspectJ type system for obtaining AjType instances.

/**
 * Provides access to the AspectJ type system
 */
public class AjTypeSystem {
    /**
     * Returns AjType for given class
     */
    public static AjType<?> getAjType(Class<?> clazz);
    
    /**
     * Returns AjTypes for given classes
     */
    public static AjType<?>[] getAjTypes(Class<?>[] classes);
}

Per Clause Support

public enum PerClauseKind {
    SINGLETON, PERCFLOW, PERCFLOWBELOW, PERTARGET, PERTHIS, PERTYPEWITHIN
}

public interface PerClause {
    PerClauseKind getKind();
}

Usage Examples

// Inspect aspect metadata
AjType<?> aspectType = AjTypeSystem.getAjType(LoggingAspect.class);
if (aspectType.isAspect()) {
    System.out.println("Per clause: " + aspectType.getPerClause().getKind());
    for (Pointcut pc : aspectType.getPointcuts()) {
        System.out.println("Pointcut: " + pc.getName());
    }
    for (Advice advice : aspectType.getAdvice()) {
        System.out.println("Advice: " + advice.getKind());
    }
}

Install with Tessl CLI

npx tessl i tessl/maven-org-aspectj--aspectjrt

docs

annotation-based-definition.md

aspect-management.md

index.md

join-point-introspection.md

reflection-api.md

runtime-utilities.md

signature-system.md

tile.json