Example usage for org.aspectj.weaver.patterns WildTypePattern isIncludeSubtypes

List of usage examples for org.aspectj.weaver.patterns WildTypePattern isIncludeSubtypes

Introduction

In this page you can find the example usage for org.aspectj.weaver.patterns WildTypePattern isIncludeSubtypes.

Prototype

public boolean isIncludeSubtypes() 

Source Link

Usage

From source file:org.caesarj.compiler.aspectj.CaesarDeclareScope.java

License:Open Source License

/**
 * Performs a lookup for the given typeName.
 * /*www.jav  a 2 s.  c  o m*/
 * @param typeName
 * @param location
 * 
 * @return TypeX
 */
public TypeX lookupType(String typeName, IHasPosition location) {

    if (context.getTypeFactory().isPrimitive(typeName))
        return TypeX.forName(typeName);

    CClass cclass = lookupClass(typeName);

    // hack - extract information if subtypes included
    boolean includeSubtypes = false;
    if (location instanceof WildTypePattern) {
        WildTypePattern pattern = (WildTypePattern) location;
        includeSubtypes = pattern.isIncludeSubtypes();
    }

    //If the lookup retrieves a crosscutting class, then its
    //aspect registry should be returned instead.
    // Hence do a lookup for the registry.
    if (cclass != null && !includeSubtypes) {
        CClass aspectType = findParentWithRegistry(cclass.getQualifiedName());
        if (aspectType != null) {
            cclass = aspectType;
        }
    }

    if (cclass == null) {
        return ResolvedTypeX.MISSING;
    } else {
        return world.get().resolve(cclass);
    }
}