Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IClasspathAttribute


  }

  private static boolean getJ2EEModuleDependency(IClasspathEntry classpathEntry) {
    IClasspathAttribute[] attrs = classpathEntry.getExtraAttributes();
    for (int i=0;i<attrs.length;i++){
      IClasspathAttribute attr = attrs[i];
      if (attr.getName().equals(IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY)){
        return true;
      }
    }
    return false;
  }
View Full Code Here


      return;
    }

    IClasspathEntry mavenLibrary = getContainer(javaProject, MAVEN_CONTAINER_PATH);

    IClasspathAttribute deployableAttribute = getDeployableAttribute(mavenLibrary);
    //If the Maven Classpath Container is set to be deployed in WTP, then do the same for the Scala one
    if (deployableAttribute != null) {
      //Add the deployable attribute only if it's not set already.
      if (getDeployableAttribute(scalaLibrary) == null) {
        addDeployableAttribute(javaProject, deployableAttribute, monitor);
View Full Code Here

                    "Entry must be of kind CPE_LIBRARY or " + "CPE_VARIABLE"); //$NON-NLS-1$
        }

        IClasspathAttribute[] extraAttributes = entry.getExtraAttributes();
        for (int i = 0; i < extraAttributes.length; i++) {
            IClasspathAttribute attrib = extraAttributes[i];
            if (IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME.equals(attrib.getName())) {
                try {
                    return new URL(attrib.getValue());
                } catch (MalformedURLException e) {
                    return null;
                }
            }
        }
View Full Code Here

        if (docPathStr != null || getName().startsWith("Java")) {
          if (docPathStr == null) {
            docPathStr = VariablesPlugin.getDefault().getGlobalVariables().getReferenceApiAsJavaDocCompatibleString();
          }
          if (docPathStr != null) {
            IClasspathAttribute javadoc = JavaCore.newClasspathAttribute(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, docPathStr);
            attributes = new IClasspathAttribute[]{ javadoc };
          }
        }
        IClasspathEntry classpathEntry = JavaCore.newLibraryEntry(jarPath, sourceJarPath, sourcePath, ClasspathEntry.NO_ACCESS_RULES, attributes, false);
        classpathEntries.add(classpathEntry);
View Full Code Here

    return false;
  }

  public String getSourceAttachmentEncoding() {
    for (int i = 0, length = this.extraAttributes.length; i < length; i++) {
      IClasspathAttribute attribute = this.extraAttributes[i];
      if (IClasspathAttribute.SOURCE_ATTACHMENT_ENCODING.equals(attribute.getName()))
        return attribute.getValue();
    }
    return null;
  }
View Full Code Here

      default :
        return null;
    }
    if (this.extraAttributes == null) return null;
    for (int i= 0; i < this.extraAttributes.length; i++) {
      IClasspathAttribute attrib= this.extraAttributes[i];
      if (IClasspathAttribute.INDEX_LOCATION_ATTRIBUTE_NAME.equals(attrib.getName())) {
        String value = attrib.getValue();
        try {
          return new URL(value);
        } catch (MalformedURLException e) {
          return null;
        }
View Full Code Here

  }

  public boolean ignoreOptionalProblems() {
    if (this.entryKind == IClasspathEntry.CPE_SOURCE) {
      for (int i = 0; i < this.extraAttributes.length; i++) {
        IClasspathAttribute attrib = this.extraAttributes[i];
        if (IClasspathAttribute.IGNORE_OPTIONAL_PROBLEMS.equals(attrib.getName())) {
          return "true".equals(attrib.getValue()); //$NON-NLS-1$
        }
      }
    }
    return false;
  }
View Full Code Here

  }

  void encodeExtraAttributes(XMLWriter writer, boolean indent, boolean newLine) {
    writer.startTag(TAG_ATTRIBUTES, indent);
    for (int i = 0; i < this.extraAttributes.length; i++) {
      IClasspathAttribute attribute = this.extraAttributes[i];
      HashMap parameters = new HashMap();
        parameters.put(TAG_ATTRIBUTE_NAME, attribute.getName());
      parameters.put(TAG_ATTRIBUTE_VALUE, attribute.getValue());
      writer.printTag(TAG_ATTRIBUTE, parameters, indent, newLine, true);
    }
    writer.endTag(TAG_ATTRIBUTES, indent, true/*insert new line*/);
  }
 
View Full Code Here

    return this.isExported;
  }

  public boolean isOptional() {
    for (int i = 0, length = this.extraAttributes.length; i < length; i++) {
      IClasspathAttribute attribute = this.extraAttributes[i];
      if (IClasspathAttribute.OPTIONAL.equals(attribute.getName()) && "true".equals(attribute.getValue())) //$NON-NLS-1$
        return true;
    }
    return false;
  }
View Full Code Here

                    "Entry must be of kind CPE_LIBRARY or " + "CPE_VARIABLE"); //$NON-NLS-1$
        }

        IClasspathAttribute[] extraAttributes = entry.getExtraAttributes();
        for (int i = 0; i < extraAttributes.length; i++) {
            IClasspathAttribute attrib = extraAttributes[i];
            if (IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME.equals(attrib.getName())) {
                try {
                    return new URL(attrib.getValue());
                } catch (MalformedURLException e) {
                    return null;
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.IClasspathAttribute

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.