當前位置: 首頁>>代碼示例>>Java>>正文


Java IClasspathEntry.getExtraAttributes方法代碼示例

本文整理匯總了Java中org.eclipse.jdt.core.IClasspathEntry.getExtraAttributes方法的典型用法代碼示例。如果您正苦於以下問題:Java IClasspathEntry.getExtraAttributes方法的具體用法?Java IClasspathEntry.getExtraAttributes怎麽用?Java IClasspathEntry.getExtraAttributes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jdt.core.IClasspathEntry的用法示例。


在下文中一共展示了IClasspathEntry.getExtraAttributes方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isMavenPomDerived

import org.eclipse.jdt.core.IClasspathEntry; //導入方法依賴的package包/類
private boolean isMavenPomDerived(final IClasspathEntry classpathEntry) {
  for (final IClasspathAttribute classpathAttribute : classpathEntry.getExtraAttributes()) {
    if (Objects.equals(classpathAttribute.getName(), "maven.pomderived")) {
      return Objects.equals(classpathAttribute.getValue(), "true");
    }
  }
  return false;
}
 
開發者ID:AndreasWBartels,項目名稱:libraries,代碼行數:9,代碼來源:IconConfigurationReader.java

示例2: hasNonDependencyAttribute

import org.eclipse.jdt.core.IClasspathEntry; //導入方法依賴的package包/類
private boolean hasNonDependencyAttribute(File jar) throws JavaModelException {
  IJavaProject javaProject = JavaCore.create(project);
  for (IClasspathEntry entry : javaProject.getRawClasspath()) {
    if (entry.getPath().toFile().equals(jar)) {
      for (IClasspathAttribute attribute : entry.getExtraAttributes()) {
        if (isNonDependencyAttribute(attribute)) {
          return true;
        }
      }
    }
  }
  return false;
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:14,代碼來源:CreateAppEngineFlexWtpProjectTest.java

示例3: compare

import org.eclipse.jdt.core.IClasspathEntry; //導入方法依賴的package包/類
private static void compare(LibraryClasspathContainer expected,
    LibraryClasspathContainer actual) {
  assertEquals(expected.getPath(), actual.getPath());
  assertEquals(expected.getKind(), actual.getKind());
  assertEquals(expected.getDescription(), actual.getDescription());
  for (int i = 0; i < expected.getClasspathEntries().length; i++) {
    IClasspathEntry classpathEntry = expected.getClasspathEntries()[i];
    IClasspathEntry otherClasspathEntry = actual.getClasspathEntries()[i];
    assertEquals(classpathEntry.getPath(), otherClasspathEntry.getPath());
    assertEquals(classpathEntry.getEntryKind(), otherClasspathEntry.getEntryKind());
    assertEquals(classpathEntry.getSourceAttachmentPath(),
        otherClasspathEntry.getSourceAttachmentPath());
    assertEquals(classpathEntry.isExported(), otherClasspathEntry.isExported());
    for (int j = 0; j < classpathEntry.getAccessRules().length; j++) {
      IAccessRule accessRule = classpathEntry.getAccessRules()[j];
      IAccessRule otherAccessRule = otherClasspathEntry.getAccessRules()[j];
      assertEquals(accessRule.getKind(), otherAccessRule.getKind());
      assertEquals(accessRule.getPattern(), otherAccessRule.getPattern());
    }
    for (int k = 0; k < classpathEntry.getExtraAttributes().length; k++) {
      IClasspathAttribute classpathAttribute = classpathEntry.getExtraAttributes()[k];
      IClasspathAttribute otherClasspathAttribute = otherClasspathEntry.getExtraAttributes()[k];
      assertEquals(classpathAttribute.getName(), otherClasspathAttribute.getName());
      assertEquals(classpathAttribute.getValue(), otherClasspathAttribute.getValue());
    }
  }
  
  List<LibraryFile> libraryFiles = actual.getLibraryFiles();
  if (libraryFiles.size() != 0) {
    for (int i = 0; i < libraryFiles.size(); i++) {
      assertEquals(libraryFiles.get(i), actual.getLibraryFiles().get(i));
    }
  }
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:35,代碼來源:LibraryClasspathContainerSerializerTest.java

示例4: getArtifactClassifier

import org.eclipse.jdt.core.IClasspathEntry; //導入方法依賴的package包/類
private static String getArtifactClassifier(IClasspathEntry entry) {
  IClasspathAttribute[] attributes = entry.getExtraAttributes();
  for(IClasspathAttribute attribute : attributes) {
    if(IClasspathManager.CLASSIFIER_ATTRIBUTE.equals(attribute.getName())) {
      return attribute.getValue();
    }
  }
  return null;
}
 
開發者ID:fbricon,項目名稱:wildfly-hive,代碼行數:10,代碼來源:MavenRuntimeClasspathProvider.java


注:本文中的org.eclipse.jdt.core.IClasspathEntry.getExtraAttributes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。