All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.linkare.zas.aspectj.AccessControlInjector.aj Maven / Gradle / Ivy

package com.linkare.zas.aspectj;

 import com.linkare.zas.api.ZasInitializer;
import com.linkare.zas.aspectj.utils.BaseZas;
import com.linkare.zas.annotation.*;

/**
 * This aspect enables the injection of access control annotations in a given
 * client project. The aspect is abstract so that this feature is optional and
 * hence, managed by the developer who uses Zás.
 * 
 * @author Paulo Zenida
 * @see AccessControlled
 * @see NotAccessControlled
 * @see AccessControlledInherited
 */
@SuppressWarnings("unchecked")
public aspect AccessControlInjector extends BaseZas {

    // ========================== Constructors ==========================
    @ZasInitializer
    protected AccessControlInjector() {
    }

    // ============== Declarations - AccessControlledInherited ==============
    /**
	 * It injects the annotation AccessControlledInherited in all
	 * non-private constructors of types having the annotation
	 * AccessControlled, which are not neither
	 * AccessControlled nor NotAccessControlled.
	 * 
	 * This declaration must be used together with the next one, so that they
	 * both declare a resource as being access controlled and as inheriting the
	 * access control requirements from its type.
	 */
    declare @constructor : 
	!@NotAccessControlled !@AccessControlled !private (@AccessControlled *..*.*+).new(..) : 
	    @AccessControlled(isInherited = true);

    /**
	 * It injects the annotation AccessControlledInherited in all
	 * non-private methods of types having the annotation
	 * AccessControlled, which are not neither
	 * AccessControlled nor NotAccessControlled.
	 * 
	 * This declaration must be used together with the next one, so that they
	 * both declare a resource as being access controlled and as inheriting the
	 * access control requirements from its type.
	 */
    declare @method : 
	!@NotAccessControlled !@AccessControlled !private * (@AccessControlled *..*+).*(..) : 
	    @AccessControlled(isInherited = true);
    
    /**
	 * It injects the annotation AccessControlledInherited in all
	 * non-private fields of types having the annotation
	 * AccessControlled, which are not neither
	 * AccessControlled nor NotAccessControlled.
	 * 
	 * This declaration must be used together with the next one, so that they
	 * both declare a resource as being access controlled and as inheriting the
	 * access control requirements from its type.
	 */
    declare @field : 
	!@NotAccessControlled !@AccessControlled !private * (@AccessControlled *..*+).* : 
	    @AccessControlled(isInherited = true);

    // ============== Declarations - AccessControllsInherited ==============
    declare @constructor : 
	!@NotAccessControlled !@AccessControls !private (@AccessControls *..*.*+).new(..) : 
	    @AccessControls(isInherited = true, value = {});

    declare @method : 
	!@NotAccessControlled !@AccessControls !private * (@AccessControls *..*+).*(..) : 
	    @AccessControls(isInherited = true, value = {});
	    
    declare @field : 
	!@NotAccessControlled !@AccessControls !private * (@AccessControls *..*+).* : 
	    @AccessControls(isInherited = true, value = {});
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy