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

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

package com.linkare.zas.aspectj;

import com.linkare.zas.api.ZasInitializer;

/**
 * This aspect enforces compile time warning and/or errors so that developers who use Zás may be warned about possible mistakes when using the framework.
 * 
 * @author Paulo Zenida
 * 
 */
public aspect PolicyEnforcer {

    @ZasInitializer
    protected PolicyEnforcer() {
    }

    // Error definitions
    declare error : 
	ZasPointcuts.accessControlledAndNotAccessControlledJoinpoints() :
	    "You cannot define this joinpoint as both access controlled and not access controlled.";

    declare error : 
	ZasPointcuts.accessControlledAndNotAccessControlledTypes() :
	    "You cannot define this type as both access controlled and not access controlled.";

    declare error : 
	ZasPointcuts.accessControlledInheritedWithoutAccessControlledType() :
	    "You cannot make this object be access control inherited unless its type is also access controlled.";

    declare error : 
	ZasPointcuts.accessControlsWithAccessControlled() :
	    "You cannot use at the same time, AccessControlled and AccessControls.";

    declare error : 
	ZasPointcuts.accessControlsAndNotAccessControlledTypes() :
	    "You cannot define this type as both access controlled and not access controlled.";

    declare error : 
	ZasPointcuts.accessControlsInheritedWithoutAccessControlledType() :
	    "You cannot make this object be access control inherited unless its type is also access controlled.";

    declare error : 
	ZasPointcuts.accessControlPolicyWithNoAccessControlled() :
	    "You cannot use @AccessControlPolicy with no @AccessControlled.";
    // TODO: add more policies.
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy