本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}