Package fr.imag.adele.apam.declarations

Examples of fr.imag.adele.apam.declarations.ComponentDeclaration


    if (getGroupRelation().getTarget() instanceof ComponentReference) {
     
      /*
       * If the group targets a component
       */
      ComponentDeclaration groupTarget = getComponent(getGroupRelation().getTarget().as(ComponentReference.class),true);

      /*
       * and the refinement targets a resource, it must be provided by the component
       */
      if (targetIsResource() && groupTarget != null && !groupTarget.getProvidedResources().contains(getTargetReference())) {
        error("Invalid target refinement in relation " + quoted(getRelation().getIdentifier()) + ", "+getTargetReference()+ " is not provided by the component specified in the group "+groupTarget.getName());
      }

      if (targetIsComponent() && getTarget() != null && groupTarget != null) {

        /*
         * and the refinement targets a most concrete component, it must be a descendant
         */

        if (groupTarget.getKind().isMoreAbstractThan(getTarget().getKind()) && ! isAncestor(getTarget(), groupTarget.getReference(),true)) {
          error("Invalid target refinement in relation " + quoted(getRelation().getIdentifier()) + ", "+getTargetReference()+ " is not a descendant of the component specified in the group "+groupTarget.getName());
        }
       
        /*
         * and the refinement targets a most abstract  component, it must be an ancestor
         */
        if (getTarget().getKind().isMoreAbstractThan(groupTarget.getKind()) && ! isAncestor(groupTarget,getTarget().getReference(),true)) {
          error("Invalid target refinement in relation " + quoted(getRelation().getIdentifier()) + ", "+getTargetReference()+ " is not a ancestor of the component specified in the group "+groupTarget.getName());
        }

        /*
         * and the refinement targets a equally abstract  component, it must be the samer
         */
        if (getTarget().getKind().equals(groupTarget.getKind()) && ! getTarget().equals(groupTarget)) {
          error("Invalid target refinement in relation " + quoted(getRelation().getIdentifier()) + ", "+getTargetReference()+ " is not compatible with the component specified in the group "+groupTarget.getName());
        }
       
      }
     
    }
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.declarations.ComponentDeclaration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.