Package org.springframework.ide.eclipse.metadata.core

Examples of org.springframework.ide.eclipse.metadata.core.RequestMappingMethodAnnotationMetadata


          childNodes = new LinkedHashSet<BeanMetadataNode>();
        }

        // Install a meta data node for every method level RequestMappings
        for (IMethodMetadata mmd : metadata.getMethodMetaData()) {
          RequestMappingMethodAnnotationMetadata requestMapping = (RequestMappingMethodAnnotationMetadata) mmd;
         
          IMethod method = (IMethod) JdtUtils.getByHandle(requestMapping.getMethodHandle());
          BeanMetadataNode node = new BeanMetadataNode(requestMapping.getMethodHandle());
          node.setLabel(requestMapping.getValueAsText()
              + BeansUIPlugin.getLabelProvider().getText(method.getDeclaringType())
              + "." + BeansUIPlugin.getLabelProvider().getText(method)); //$NON-NLS-1$
          node.setImage(BeansUIPlugin.getLabelProvider().getImage(method));
          node.setLocation(requestMapping.getElementSourceLocation());
          childNodes.add(node);
        }

        if (parent != null) {
          parent.setChildren(childNodes.toArray());
View Full Code Here


    IMember member = null;
    if (obj instanceof RequestMappingAnnotationMetadata) {
      RequestMappingAnnotationMetadata annotation = (RequestMappingAnnotationMetadata) obj;
      member = (IType) JavaCore.create(annotation.getClassHandle());
    } else if (obj instanceof RequestMappingMethodToClassMap) {
      RequestMappingMethodAnnotationMetadata annotation = ((RequestMappingMethodToClassMap) obj)
          .getMethodMetadata();
      member = (IMethod) JdtUtils.getByHandle(annotation
          .getHandleIdentifier());

    }
    return member;
  }
View Full Code Here

    if (obj instanceof RequestMappingAnnotationMetadata) {
      RequestMappingAnnotationMetadata annotation = (RequestMappingAnnotationMetadata) obj;
      sourceLocation = annotation.getElementSourceLocation();
    } else if (obj instanceof RequestMappingMethodToClassMap) {
      RequestMappingMethodAnnotationMetadata annotation = ((RequestMappingMethodToClassMap) obj)
          .getMethodMetadata();
      sourceLocation = annotation.getElementSourceLocation();
    }

    if (sourceLocation != null) {
      SpringUIUtils.openInEditor(((FileResource) sourceLocation
          .getResource()).getRawFile(),
View Full Code Here

  }

  public Image getColumnImage(Object element, int columnIndex) {
    if (element instanceof RequestMappingMethodToClassMap) {
      if (columnIndex == RequestMappingView.COLUMN_HANDLER_METHOD) {
        RequestMappingMethodAnnotationMetadata annotation = ((RequestMappingMethodToClassMap) element)
            .getMethodMetadata();
        IMethod method = (IMethod) JdtUtils.getByHandle(annotation
            .getHandleIdentifier());
        return javaLabelProvider.getImage(method);
      }
    }
    return null;
View Full Code Here

    return "/"; //$NON-NLS-1$
  }

  @SuppressWarnings("unchecked")
  private String getMethodUrl(RequestMappingMethodToClassMap map) {
    RequestMappingMethodAnnotationMetadata annotation = map
        .getMethodMetadata();
    String classUrl = getClassUrl(map.getClassMetadata());
    Object value = annotation.getValue();
    if (value instanceof Set) {
      for (AnnotationMemberValuePair pair : (Set<AnnotationMemberValuePair>) value) {
        if (pair.getName() == null) {
          if (classUrl.equals("/") && pair.getValue().startsWith("/")) { //$NON-NLS-1$ //$NON-NLS-2$
            return pair.getValue();
View Full Code Here

    return null;
  }
 
  @SuppressWarnings("unchecked")
  private String getRequestMethod(RequestMappingMethodToClassMap map) {
    RequestMappingMethodAnnotationMetadata annotation = map
        .getMethodMetadata();
    String classMethod = extractMethodFromAnnotation(map.getClassMetadata());
    String requestMethod = extractMethodFromAnnotation(annotation);
    if (requestMethod != null) {
      return requestMethod;
View Full Code Here

    }
    return ""; //$NON-NLS-1$
  }
 
  private String getHandlerMethod(RequestMappingMethodToClassMap map) {
    RequestMappingMethodAnnotationMetadata annotation = map
        .getMethodMetadata();
    IMethod method = (IMethod) JdtUtils.getByHandle(annotation
        .getHandleIdentifier());
    return javaLabelProvider.getText(method.getDeclaringType()) + "." //$NON-NLS-1$
        + javaLabelProvider.getText(method);
  }
View Full Code Here

      RequestMappingAnnotationMetadata annotation = (RequestMappingAnnotationMetadata) obj;
      IType type = (IType) JavaCore.create(annotation.getClassHandle());
      breakpointAdapter.toggleClassBreakpoints(workbenchPart,
          new StructuredSelection(type));
    } else if (obj instanceof RequestMappingMethodToClassMap) {
      RequestMappingMethodAnnotationMetadata annotation = ((RequestMappingMethodToClassMap) obj)
          .getMethodMetadata();
      IMethod method = (IMethod) JavaCore.create(annotation
          .getHandleIdentifier());
      breakpointAdapter.toggleMethodBreakpoints(workbenchPart,
          new StructuredSelection(method));
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.metadata.core.RequestMappingMethodAnnotationMetadata

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.