当前位置: 首页>>代码示例>>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;未经允许,请勿转载。