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


Java Discovery類代碼示例

本文整理匯總了Java中jenkins.scm.impl.trait.Discovery的典型用法代碼示例。如果您正苦於以下問題:Java Discovery類的具體用法?Java Discovery怎麽用?Java Discovery使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: getTraitsDescriptorLists

import jenkins.scm.impl.trait.Discovery; //導入依賴的package包/類
public List<NamedArrayList<? extends SCMTraitDescriptor<?>>> getTraitsDescriptorLists() {
    List<SCMTraitDescriptor<?>> all = new ArrayList<>();
    //all.addAll(SCMSourceTrait._for(this, GitHubSCMSourceContext.class, null));
    all.addAll(SCMSourceTrait._for(this, null, GiteaSCMBuilder.class));
    Set<SCMTraitDescriptor<?>> dedup = new HashSet<>();
    for (Iterator<SCMTraitDescriptor<?>> iterator = all.iterator(); iterator.hasNext(); ) {
        SCMTraitDescriptor<?> d = iterator.next();
        if (dedup.contains(d)
                || d instanceof GitBrowserSCMSourceTrait.DescriptorImpl) {
            // remove any we have seen already and ban the browser configuration as it will always be github
            iterator.remove();
        } else {
            dedup.add(d);
        }
    }
    List<NamedArrayList<? extends SCMTraitDescriptor<?>>> result = new ArrayList<>();
    NamedArrayList.select(all, Messages.GiteaSCMSource_traitSection_withinRepo(), NamedArrayList
                    .anyOf(NamedArrayList.withAnnotation(Discovery.class),
                            NamedArrayList.withAnnotation(Selection.class)),
            true, result);
    NamedArrayList.select(all, Messages.GiteaSCMSource_traitSection_additional(), null, true, result);
    return result;
}
 
開發者ID:jenkinsci,項目名稱:gitea-plugin,代碼行數:24,代碼來源:GiteaSCMSource.java

示例2: getTraitsDescriptorLists

import jenkins.scm.impl.trait.Discovery; //導入依賴的package包/類
@SuppressWarnings("unused") // jelly
public List<NamedArrayList<? extends SCMTraitDescriptor<?>>> getTraitsDescriptorLists() {
    GiteaSCMSource.DescriptorImpl sourceDescriptor =
            Jenkins.getActiveInstance().getDescriptorByType(GiteaSCMSource.DescriptorImpl.class);
    List<SCMTraitDescriptor<?>> all = new ArrayList<>();
    all.addAll(SCMNavigatorTrait._for(this, GiteaSCMNavigatorContext.class, GiteaSCMSourceBuilder.class));
    all.addAll(SCMSourceTrait._for(sourceDescriptor, GiteaSCMSourceContext.class, null));
    all.addAll(SCMSourceTrait._for(sourceDescriptor, null, GiteaSCMBuilder.class));
    Set<SCMTraitDescriptor<?>> dedup = new HashSet<>();
    for (Iterator<SCMTraitDescriptor<?>> iterator = all.iterator(); iterator.hasNext(); ) {
        SCMTraitDescriptor<?> d = iterator.next();
        if (dedup.contains(d)
                || d instanceof GitBrowserSCMSourceTrait.DescriptorImpl) {
            // remove any we have seen already and ban the browser configuration as it will always be github
            iterator.remove();
        } else {
            dedup.add(d);
        }
    }
    List<NamedArrayList<? extends SCMTraitDescriptor<?>>> result = new ArrayList<>();
    NamedArrayList.select(all, Messages.GiteaSCMNavigator_traitSection_repositories(), new NamedArrayList.Predicate<SCMTraitDescriptor<?>>() {
                @Override
                public boolean test(SCMTraitDescriptor<?> scmTraitDescriptor) {
                    return scmTraitDescriptor instanceof SCMNavigatorTraitDescriptor;
                }
            },
            true, result);
    NamedArrayList.select(all, Messages.GiteaSCMNavigator_traitSection_withinRepo(), NamedArrayList
                    .anyOf(NamedArrayList.withAnnotation(Discovery.class),
                            NamedArrayList.withAnnotation(Selection.class)),
            true, result);
    NamedArrayList.select(all, Messages.GiteaSCMNavigator_traitSection_additional(), null, true, result);
    return result;
}
 
開發者ID:jenkinsci,項目名稱:gitea-plugin,代碼行數:35,代碼來源:GiteaSCMNavigator.java

示例3: getTraitsDescriptorLists

import jenkins.scm.impl.trait.Discovery; //導入依賴的package包/類
/**
 * Populates the available trait descriptors.
 *
 * @return the available trait descriptors.
 */
@SuppressWarnings("unused") // jelly
public List<NamedArrayList<? extends SCMTraitDescriptor<?>>> getTraitsDescriptorLists() {
    GitSCMSource.DescriptorImpl sourceDescriptor =
            ExtensionList.lookup(Descriptor.class).get(GitSCMSource.DescriptorImpl.class);
    List<SCMTraitDescriptor<?>> all = new ArrayList<>();
    all.addAll(SCMNavigatorTrait._for(this, ASFGitSCMNavigatorContext.class, ASFGitSCMSourceBuilder.class));
    all.addAll(SCMSourceTrait._for(sourceDescriptor, GitSCMSourceContext.class, null));
    all.addAll(SCMSourceTrait._for(sourceDescriptor, null, GitSCMBuilder.class));
    Set<SCMTraitDescriptor<?>> dedup = new HashSet<>();
    for (Iterator<SCMTraitDescriptor<?>> iterator = all.iterator(); iterator.hasNext(); ) {
        SCMTraitDescriptor<?> d = iterator.next();
        if (dedup.contains(d)
                || d instanceof GitBrowserSCMSourceTrait.DescriptorImpl) {
            // remove any we have seen already and ban the browser configuration as it will always be github
            iterator.remove();
        } else {
            dedup.add(d);
        }
    }
    List<NamedArrayList<? extends SCMTraitDescriptor<?>>> result = new ArrayList<>();
    NamedArrayList.select(all, Messages.ASFGitSCMNavigator_ASFGitSCMNaviagort_repositories(),
            new NamedArrayList.Predicate<SCMTraitDescriptor<?>>() {
                @Override
                public boolean test(SCMTraitDescriptor<?> scmTraitDescriptor) {
                    return scmTraitDescriptor instanceof SCMNavigatorTraitDescriptor;
                }
            },
            true, result);
    NamedArrayList.select(all, Messages.ASFGitSCMNavigator_withinRepositories(),
            NamedArrayList.anyOf(NamedArrayList.withAnnotation(Discovery.class),
                    NamedArrayList.withAnnotation(Selection.class)),
            true, result);
    NamedArrayList.select(all, Messages.ASFGitSCMNavigator_additionalBehaviours(), null, true, result);
    return result;
}
 
開發者ID:stephenc,項目名稱:asf-gitpubsub-jenkins-plugin,代碼行數:41,代碼來源:ASFGitSCMNavigator.java

示例4: getTraitsDescriptorLists

import jenkins.scm.impl.trait.Discovery; //導入依賴的package包/類
public List<NamedArrayList<? extends SCMSourceTraitDescriptor>> getTraitsDescriptorLists() {
  List<NamedArrayList<? extends SCMSourceTraitDescriptor>> result = new ArrayList<>();
  List<SCMSourceTraitDescriptor> descriptors =
      SCMSourceTrait._for(this, GitSCMSourceContext.class, GitSCMBuilder.class);
  NamedArrayList.select(
      descriptors,
      "Within Repository",
      NamedArrayList.anyOf(
          NamedArrayList.withAnnotation(Selection.class),
          NamedArrayList.withAnnotation(Discovery.class)),
      true,
      result);
  NamedArrayList.select(descriptors, "Additional", null, true, result);
  return result;
}
 
開發者ID:GerritForge,項目名稱:gerrit-plugin,代碼行數:16,代碼來源:GerritSCMSource.java


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