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

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


    Object[] children = super.getChildren();
    for (Object child : children) {
      if (child instanceof RequestMappingAnnotationMetadata) {
        Set<BeanMetadataNode> childNodes = nodes;
        BeanMetadataNode parent = null;
        RequestMappingAnnotationMetadata metadata = (RequestMappingAnnotationMetadata) child;

        // Check if there is a class level RequestMapping defined. If so install a class
        // level meta data node.
        if (metadata.getValue() != null) {
          parent = new BeanMetadataNode(metadata.getHandleIdentifier());
          IType type = (IType) JavaCore.create(metadata.getClassHandle());
          parent.setLabel(metadata.getValueAsText()
              + BeansUIPlugin.getLabelProvider().getText(type));
          parent.setImage(BeansUIPlugin.getLabelProvider().getImage(type));
          parent.setLocation(metadata.getElementSourceLocation());
          nodes.add(parent);
          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()
View Full Code Here


  }

  private IMember findJavaMember(Object obj) {
    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

    IModelSourceLocation sourceLocation = null;
    IStructuredSelection selection = getStructuredSelection();
    Object obj = selection.getFirstElement();

    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 void run() {
    IStructuredSelection selection = getStructuredSelection();
    Object obj = selection.getFirstElement();

    if (obj instanceof RequestMappingAnnotationMetadata) {
      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.RequestMappingAnnotationMetadata

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.