Examples of XmlSourceLocation


Examples of org.springframework.ide.eclipse.core.model.xml.XmlSourceLocation

    text.append(key);
    return text.toString();
  }

  private void setLocation(Map.Entry<?, ?> entry) {
    XmlSourceLocation location = null;
    Object key = entry.getKey();
    if (key instanceof BeanMetadataElement) {
      Object source = ((BeanMetadataElement) key).getSource();
      if (source instanceof XmlSourceLocation) {
        location = new XmlSourceLocation((XmlSourceLocation) source);
      }
    }

    Object value = entry.getValue();
    if (value instanceof BeanMetadataElement) {
      Object source = ((BeanMetadataElement) value).getSource();
      if (source instanceof XmlSourceLocation) {
        if (location == null) {
          location = new XmlSourceLocation((XmlSourceLocation)
              source);
        } else {
          location.setEndLine(((XmlSourceLocation) source)
              .getEndLine());
        }
      }
    }
    if (location != null) {
      location.setLocalName("<entry");
      setElementSourceLocation(location);
    }
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.xml.XmlSourceLocation

  protected Label createLabel(Bean bean) {
    Label label = new Label();
    if (bean.getBean() != null
        && bean.getBean().getElementSourceLocation() instanceof XmlSourceLocation) {
      // Add prefix and node name so that source of the element is more obivous
      XmlSourceLocation location = (XmlSourceLocation) bean.getBean()
          .getElementSourceLocation();
      StringBuilder text = new StringBuilder();
      if (location != null) {
        if (location.getPrefix() != null) {
        text.append(location.getPrefix()).append(":").append(location.getLocalName())
            .append(" ");
        }
        else if (!NamespaceUtils.DEFAULT_NAMESPACE_URI.equals(location.getNamespaceURI())){
          text.append(location.getLocalName()).append(" ");
        }
      }
      text.append(bean.getName());
      label.setText(text.toString());
    }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.xml.XmlSourceLocation

  /**
   * Returns the namespace URI for the given element or <code>null</code> if
   * no {@link XmlSourceLocation} with a valid namespace URI found.
   */
  public static String getNameSpaceURI(ISourceModelElement element) {
    XmlSourceLocation location = getXmlSourceLocation(element);
    return (location != null ? location.getNamespaceURI() : null);
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.xml.XmlSourceLocation

  /**
   * Returns the node's local name for the given element or <code>null</code>
   * if no {@link XmlSourceLocation} with a valid local name found.
   */
  public static String getLocalName(ISourceModelElement element) {
    XmlSourceLocation location = getXmlSourceLocation(element);
    return (location != null ? location.getLocalName() : null);
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.xml.XmlSourceLocation

  /**
   * Returns the node name for the given element or <code>null</code>
   * if no {@link XmlSourceLocation} with a valid node name found.
   */
  public static String getNodeName(ISourceModelElement element) {
    XmlSourceLocation location = getXmlSourceLocation(element);
    return (location != null ? location.getNodeName() : null);
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.xml.XmlSourceLocation

  private URI getLocation(IResourceModelElement element) {
    if (element instanceof AbstractSourceModelElement) {
      AbstractSourceModelElement sourceElement = (AbstractSourceModelElement) element;
      IModelSourceLocation sourceLocation = sourceElement.getElementSourceLocation();
      if (sourceLocation instanceof XmlSourceLocation) {
        XmlSourceLocation xmlSourceLocation = (XmlSourceLocation) sourceLocation;
        Resource resource = xmlSourceLocation.getResource();
        try {
          File file = resource.getFile();
          if (file != null) {
            return file.toURI();
          }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.model.xml.XmlSourceLocation

    return false;
  }
 
  private boolean doesAnnotationScanning(IBeansComponent component) {
    if (component.getElementSourceLocation() instanceof XmlSourceLocation) {
      XmlSourceLocation location = (XmlSourceLocation) component.getElementSourceLocation();
      if (COMPONENT_SCAN_ELEMENT_NAME.equals(location.getLocalName())
          && CONTEXT_NAMESPACE_URI.equals(location.getNamespaceURI())) {
        return true;
      }
      else if (ANNOTATION_CONFIG_ELEMENT_NAME.equals(location.getLocalName())
          && CONTEXT_NAMESPACE_URI.equals(location.getNamespaceURI())) {
        return true;
      }
    }
   
    for (IBeansComponent childComponent : component.getComponents()) {
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.