Examples of IAopReference


Examples of org.springframework.ide.eclipse.aop.core.model.IAopReference

              else {
                jdtAspectMember = jdtAspectType;
              }

              if (jdtAspectMember != null) {
                IAopReference ref = new AopReference(info.getType(), jdtAspectMember, JdtUtils
                    .getLineNumber(jdtAspectMember), jdtTargetType, JdtUtils
                    .getLineNumber(jdtTargetType), info, file, bean);
                aopProject.addAopReference(ref);
              }
            }
          }
          else if (info instanceof BeanAspectDefinition) {
            IMethod jdtAspectMethod = null;

            if (info instanceof JavaAdvisorDefinition) {
              jdtAspectMethod = JdtUtils.getMethod(jdtAspectType, info.getAdviceMethodName(), info
                  .getAdviceMethodParameterTypes());
            }
            else {
              // validate the aspect definition
              if (info.getAdviceMethod() == null) {
                return;
              }
              jdtAspectMethod = JdtUtils.getMethod(jdtAspectType, info.getAdviceMethodName(), info
                  .getAdviceMethod().getParameterTypes());
            }

            if (jdtAspectMethod != null) {
              // long start = System.currentTimeMillis();
              Set<IMethod> matchingMethods = aspectDefinitionMatcher.matches(targetClass, bean, info,
                  aopProject.getProject().getProject());
              for (IMethod method : matchingMethods) {
                IAopReference ref = new AopReference(info.getType(), jdtAspectMethod, JdtUtils
                    .getLineNumber(jdtAspectMethod), method, JdtUtils.getLineNumber(method), info,
                    file, bean);
                aopProject.addAopReference(ref);
              }
              // System.out.println(String.format("--- matching on '%s' took '%s'", targetClass, (System
View Full Code Here

Examples of org.springframework.ide.eclipse.aop.core.model.IAopReference

          break;
        }
      }
    }
    else if (element instanceof AdvisedAopSourceNode) {
      IAopReference reference = ((AdvisedAopSourceNode) element).getReference();
      if (reference.getDefinition() instanceof IAnnotationAopDefinition) {
        decoration.addOverlay(AopReferenceModelImages.DESC_OVR_ANNOTATION,
            IDecoration.BOTTOM_LEFT);
      }
    }
    else if (element instanceof AdviceDeclareParentAopSourceNode) {
      IAopReference reference = ((AdviceDeclareParentAopSourceNode) element).getReference();
      if (reference.getDefinition() instanceof IAnnotationAopDefinition) {
        decoration.addOverlay(AopReferenceModelImages.DESC_OVR_ANNOTATION,
            IDecoration.BOTTOM_LEFT);
      }
    }
    else if (element instanceof AdvisedDeclareParentAopSourceNode) {
      IAopReference reference = ((AdvisedDeclareParentAopSourceNode) element).getReference();
      if (reference.getDefinition() instanceof IAnnotationAopDefinition) {
        decoration.addOverlay(AopReferenceModelImages.DESC_OVR_ANNOTATION,
            IDecoration.BOTTOM_LEFT);
      }
    }
    // add overlay to IBeans
View Full Code Here

Examples of org.springframework.ide.eclipse.aop.core.model.IAopReference

      Object[] elements = result.getElements();
      List<Object> children = new ArrayList<Object>();
      for (Object element : elements) {
        if (element instanceof IAopReference
            && parentElement instanceof IBeansModelElement) {
          IAopReference reference = (IAopReference) element;
          IModelElement me = BeansCorePlugin.getModel().getElement(
              reference.getTargetBeanId());
          if (me != null) {
            Object child = BeansModelUtils.getChildForElement(
                (IModelElement) parentElement,
                (IModelElement) me);
            if (child instanceof IBeansConfig) {
View Full Code Here

Examples of org.springframework.ide.eclipse.aop.core.model.IAopReference

      // Create list of projects the matched beans belong to
      Object[] elements = result.getElements();
      List<IModelElement> projects = new ArrayList<IModelElement>();
      for (Object element : elements) {
        if (element instanceof IAopReference) {
          IAopReference reference = (IAopReference) element;
          IModelElement me = BeansCorePlugin.getModel().getElement(
              reference.getTargetBeanId());
          if (me != null) {
            IModelElement project = BeansModelUtils
                .getChildForElement(BeansCorePlugin.getModel(),
                    (IModelElement) me);
            if (!projects.contains(project)) {
View Full Code Here

Examples of org.springframework.ide.eclipse.aop.core.model.IAopReference

  @Override
  public String getText(Object element) {
    if (element instanceof IAopReference
        && this.pointcutMatcherResultPage.getLayout()
        == AbstractTextSearchViewPage.FLAG_LAYOUT_FLAT) {
      IAopReference reference = (IAopReference) element;
      IBean bean = (IBean) BeansCorePlugin.getModel().getElement(
          reference.getTargetBeanId());
      String text = super.getText(reference.getTarget()) + " - "
          + super.getText(bean);
      return text;
    }
    return super.getText(element);
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.aop.core.model.IAopReference

        String className = BeansModelUtils.getBeanClass(bean, null);
        try {
          Class<?> targetClass = ClassUtils.loadClass(className);
          Set<IMethod> matchingMethods = matcher.matches(targetClass, bean, definition, project);
          for (IMethod method : matchingMethods) {
            IAopReference ref = new AopReference(definition.getType(), null, -1, method, JdtUtils
                .getLineNumber(method), definition, bean.getElementResource(), bean);
            references.add(ref);
          }
        }
        catch (Throwable e) {
View Full Code Here

Examples of org.springframework.ide.eclipse.aop.core.model.IAopReference

    String factoryId;
    IMemento[] aopReferences = aspectDefinitionM.getChildren(AOP_REFERENCE_ELEMENT);
    if (aopReferences != null && aopReferences.length > 0) {
      for (IMemento aopReferenceM : aopReferences) {
        factoryId = aopReferenceM.getString(FACTORY_ID);
        IAopReference aopReference = (IAopReference) ELEMENT_FACTORIES.get(factoryId)
            .createElement(aopReferenceM);
        // The aopReference can be null if the resource has been deleted or is an external
        if (aopReference != null) {
          aopReference.setDefinition(aspectDefinition);
          aopProject.addAopReference(aopReference);
        }
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.