hudson.model.Hudson.getDescriptorByType()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(206)

本文整理了Java中hudson.model.Hudson.getDescriptorByType()方法的一些代码示例,展示了Hudson.getDescriptorByType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hudson.getDescriptorByType()方法的具体详情如下:
包路径:hudson.model.Hudson
类名称:Hudson
方法名:getDescriptorByType

Hudson.getDescriptorByType介绍

[英]Gets the Descriptor instance in the current Hudson by its type.
[中]按类型获取当前Hudson中的描述符实例。

代码示例

代码示例来源:origin: org.jvnet.hudson.main/hudson-test-harness

/**
 * Gets the descriptor instance of the current Hudson by its type.
 */
protected <T extends Descriptor<?>> T get(Class<T> d) {
  return hudson.getDescriptorByType(d);
}

代码示例来源:origin: org.eclipse.hudson/hudson-test-framework

/**
 * Gets the descriptor instance of the current Hudson by its type.
 */
protected <T extends Descriptor<?>> T get(Class<T> d) {
  return hudson.getDescriptorByType(d);
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-test-framework

/**
 * Gets the descriptor instance of the current Hudson by its type.
 */
protected <T extends Descriptor<?>> T get(Class<T> d) {
  return hudson.getDescriptorByType(d);
}

代码示例来源:origin: jenkinsci/gerrit-trigger-plugin

/**
 * Getter for the Descriptor.
 * @return the Descriptor for the PluginDraftPublishedEvent.
 */
@Override
public Descriptor<PluginGerritEvent> getDescriptor() {
  return Hudson.getInstance().getDescriptorByType(PluginDraftPublishedEventDescriptor.class);
}

代码示例来源:origin: jenkinsci/gerrit-trigger-plugin

/**
 * Getter for the Descriptor.
 * @return the Descriptor for the PluginRefUpdatedEvent.
 */
@Override
public Descriptor<PluginGerritEvent> getDescriptor() {
  return Hudson.getInstance().getDescriptorByType(PluginRefUpdatedEventDescriptor.class);
}

代码示例来源:origin: jenkinsci/gerrit-trigger-plugin

/**
 * Getter for the Descriptor.
 * @return the Descriptor for the PluginChangeMergedEvent.
 */
@Override
public Descriptor<PluginGerritEvent> getDescriptor() {
  return Hudson.getInstance().getDescriptorByType(PluginChangeMergedEventDescriptor.class);
}

代码示例来源:origin: org.hudsonci.plugins/run-condition

public Day.DayDescriptor getDayDescriptor() {
  return Hudson.getInstance().getDescriptorByType(Day.DayDescriptor.class);
}
public static ArrayList<Day> getAllDays() {

代码示例来源:origin: jenkinsci/build-failure-analyzer-plugin

@Override
@JsonIgnore
public IndicationDescriptor getDescriptor() {
  return Hudson.getInstance().getDescriptorByType(BuildLogIndicationDescriptor.class);
}

代码示例来源:origin: org.hudsonci.plugins/warnings

private static Iterable<GroovyParser> getDynamicParserDescriptions() {
  Hudson instance = Hudson.getInstance();
  if (instance != null) {
    WarningsDescriptor descriptor = instance.getDescriptorByType(WarningsDescriptor.class);
    if (descriptor != null) {
      return Lists.newArrayList(descriptor.getParsers());
    }
  }
  return Collections.emptyList();
}

代码示例来源:origin: org.jvnet.hudson.plugins/warnings

private static Iterable<GroovyParser> getDynamicParserDescriptions() {
  Hudson instance = Hudson.getInstance();
  if (instance != null) {
    WarningsDescriptor descriptor = instance.getDescriptorByType(WarningsDescriptor.class);
    if (descriptor != null) {
      return descriptor.getParsers();
    }
  }
  return Collections.emptyList();
}

代码示例来源:origin: org.jvnet.hudson.plugins/git

/**
 * Lists available toolinstallations.
 *
 * @return list of available git tools
 */
public List<GitTool> getGitTools() {
  GitTool[] gitToolInstallations = Hudson.getInstance()
    .getDescriptorByType(GitTool.DescriptorImpl.class)
    .getInstallations();
  return Arrays.asList(gitToolInstallations);
}

代码示例来源:origin: jenkinsci/shiningpanda-plugin

/**
   * Get a shell
   * 
   * @param channel
   *            The channel
   * @return The shell to use to launch the script file
   */
  protected static String getShell(VirtualChannel channel) {
  return Hudson.getInstance().getDescriptorByType(Shell.DescriptorImpl.class).getShellOrDefault(channel);
  }
}

代码示例来源:origin: org.jvnet.hudson.plugins/subversion

public Integer call()  {
    return Hudson.getInstance().getDescriptorByType(SubversionSCM.DescriptorImpl.class).getWorkspaceFormat();
  }
});

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

@Override
public void setInstallations(AntInstallation... installations) {
  Hudson.getInstance().getDescriptorByType(Ant.DescriptorImpl.class).setInstallations(installations);
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

@Override
public void setInstallations(MavenInstallation... installations) {
  Hudson.getInstance().getDescriptorByType(Maven.DescriptorImpl.class).setInstallations(installations);
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

@Override
public AntInstallation[] getInstallations() {
  return Hudson.getInstance().getDescriptorByType(Ant.DescriptorImpl.class).getInstallations();
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

@Override
public AntInstallation[] getInstallations() {
  return Hudson.getInstance().getDescriptorByType(Ant.DescriptorImpl.class).getInstallations();
}

代码示例来源:origin: org.eclipse.hudson/hudson-test-framework

protected MavenInstallation configureMaven3() throws Exception {
  MavenInstallation mvn = configureDefaultMaven("apache-maven-3.0.1", MavenInstallation.MAVEN_30);
  MavenInstallation m3 = new MavenInstallation("apache-maven-3.0.1", mvn.getHome(), NO_PROPERTIES);
  hudson.getDescriptorByType(Maven.DescriptorImpl.class).setInstallations(m3);
  return m3;
}

代码示例来源:origin: org.jvnet.hudson.plugins/ci-game

/**
 * Returns the user that are participants in the ci game
 * 
 * @return list containing users.
 */
@Exported
public List<UserScore> getUserScores() {
  return getUserScores(User.getAll(), Hudson.getInstance().getDescriptorByType(GameDescriptor.class).getNamesAreCaseSensitive());
}

代码示例来源:origin: jenkinsci/ci-game-plugin

/**
 * Returns the user that are participants in the ci game
 * 
 * @return list containing users.
 */
@Exported
public List<UserScore> getUserScores() {
  return getUserScores(User.getAll(), Hudson.getInstance().getDescriptorByType(GameDescriptor.class).getNamesAreCaseSensitive());
}

相关文章

Hudson类方法