hudson.triggers.Trigger.all()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(211)

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

Trigger.all介绍

[英]Returns all the registered Trigger descriptors.
[中]返回所有已注册的触发器描述符。

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Gets the trigger descriptor by name. Primarily used for making them web-visible.
 */
public TriggerDescriptor getTrigger(String shortClassName) {
  return (TriggerDescriptor) findDescriptor(shortClassName, Trigger.all());
}

代码示例来源:origin: jenkinsci/jenkins

/**
   * Returns a subset of {@link TriggerDescriptor}s that applys to the given item.
   */
  public static List<TriggerDescriptor> for_(Item i) {
    List<TriggerDescriptor> r = new ArrayList<>();
    for (TriggerDescriptor t : all()) {
      if(!t.isApplicable(i))  continue;

      if (i instanceof TopLevelItem) {// ugly
        TopLevelItemDescriptor tld = ((TopLevelItem) i).getDescriptor();
        // tld shouldn't be really null in contract, but we often write test Describables that
        // doesn't have a Descriptor.
        if(tld!=null && !tld.isApplicable(t))    continue;
      }

      r.add(t);
    }
    return r;
  }
}

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

@Initializer(after = InitMilestone.JOB_LOADED)
public static void migrateJobs() throws IOException {
  GitLabPushTrigger.DescriptorImpl oldConfig = Trigger.all().get(GitLabPushTrigger.DescriptorImpl.class);
  if (!oldConfig.jobsMigrated) {
    GitLabConnectionConfig gitLabConfig = (GitLabConnectionConfig) Jenkins.getInstance().getDescriptor(GitLabConnectionConfig.class);

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

/**
 * Gets the trigger descriptor by name. Primarily used for making them web-visible.
 */
public TriggerDescriptor getTrigger(String shortClassName) {
  return (TriggerDescriptor) findDescriptor(shortClassName, Trigger.all());
}

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

/**
 * Gets the trigger descriptor by name. Primarily used for making them web-visible.
 */
public TriggerDescriptor getTrigger(String shortClassName) {
  return (TriggerDescriptor) findDescriptor(shortClassName, Trigger.all());
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Gets the trigger descriptor by name. Primarily used for making them web-visible.
 */
public TriggerDescriptor getTrigger(String shortClassName) {
  return (TriggerDescriptor) findDescriptor(shortClassName, Trigger.all());
}

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

/**
 * Gets the trigger descriptor by name. Primarily used for making them
 * web-visible.
 */
public TriggerDescriptor getTrigger(String shortClassName) {
  return (TriggerDescriptor) findDescriptor(shortClassName, Trigger.all());
}

代码示例来源:origin: KostyaSha/github-integration-plugin

public static DescriptorImpl get() {
    return Trigger.all().get(DescriptorImpl.class);
  }
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Gets the trigger descriptor by name. Primarily used for making them web-visible.
 */
public TriggerDescriptor getTrigger(String shortClassName) {
  return (TriggerDescriptor) findDescriptor(shortClassName, Trigger.all());
}

代码示例来源:origin: KostyaSha/github-integration-plugin

public static DescriptorImpl get() {
    return Trigger.all().get(DescriptorImpl.class);
  }
}

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

public static DescriptorImpl get() {
  return Trigger.all().get(DescriptorImpl.class);
}

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

/**
 * Returns a subset of {@link TriggerDescriptor}s that applys to the given item.
 */
public static List<TriggerDescriptor> for_(Item i) {
  List<TriggerDescriptor> r = new ArrayList<TriggerDescriptor>();
  for (TriggerDescriptor t : all()) {
    if(!t.isApplicable(i))  continue;
    if (i instanceof TopLevelItem) {// ugly
      TopLevelItemDescriptor tld = ((TopLevelItem) i).getDescriptor();
      // tld shouldn't be really null in contract, but we often write test Describables that
      // doesn't have a Descriptor.
      if(tld!=null && !tld.isApplicable(t))    continue;
    }
    r.add(t);
  }
  return r;
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
   * Returns a subset of {@link TriggerDescriptor}s that applys to the given item.
   */
  public static List<TriggerDescriptor> for_(Item i) {
    List<TriggerDescriptor> r = new ArrayList<>();
    for (TriggerDescriptor t : all()) {
      if(!t.isApplicable(i))  continue;

      if (i instanceof TopLevelItem) {// ugly
        TopLevelItemDescriptor tld = ((TopLevelItem) i).getDescriptor();
        // tld shouldn't be really null in contract, but we often write test Describables that
        // doesn't have a Descriptor.
        if(tld!=null && !tld.isApplicable(t))    continue;
      }

      r.add(t);
    }
    return r;
  }
}

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

/**
 * Returns a subset of {@link TriggerDescriptor}s that applys to the given item.
 */
public static List<TriggerDescriptor> for_(Item i) {
  List<TriggerDescriptor> r = new ArrayList<TriggerDescriptor>();
  for (TriggerDescriptor t : all()) {
    if(!t.isApplicable(i))  continue;
    if (i instanceof TopLevelItem) {// ugly
      TopLevelItemDescriptor tld = ((TopLevelItem) i).getDescriptor();
      // tld shouldn't be really null in contract, but we often write test Describables that
      // doesn't have a Descriptor.
      if(tld!=null && !tld.isApplicable(t))    continue;
    }
    r.add(t);
  }
  return r;
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Returns a subset of {@link TriggerDescriptor}s that applys to the given item.
 */
public static List<TriggerDescriptor> for_(Item i) {
  List<TriggerDescriptor> r = new ArrayList<TriggerDescriptor>();
  for (TriggerDescriptor t : all()) {
    if(!t.isApplicable(i))  continue;
    if (i instanceof TopLevelItem) {// ugly
      TopLevelItemDescriptor tld = ((TopLevelItem) i).getDescriptor();
      // tld shouldn't be really null in contract, but we often write test Describables that
      // doesn't have a Descriptor.
      if(tld!=null && !tld.isApplicable(t))    continue;
    }
    r.add(t);
  }
  return r;
}

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

/**
 * Returns a subset of {@link TriggerDescriptor}s that applys to the given
 * item.
 */
public static List<TriggerDescriptor> for_(Item i) {
  List<TriggerDescriptor> r = new ArrayList<TriggerDescriptor>();
  for (TriggerDescriptor t : all()) {
    if (!t.isApplicable(i)) {
      continue;
    }
    if (i instanceof TopLevelItem) {// ugly
      TopLevelItemDescriptor tld = ((TopLevelItem) i).getDescriptor();
      // tld shouldn't be really null in contract, but we often write test Describables that
      // doesn't have a Descriptor.
      if (tld != null && !tld.isApplicable(t)) {
        continue;
      }
    }
    r.add(t);
  }
  return r;
}

代码示例来源:origin: jenkinsci/multi-branch-project-plugin

DescriptorExtensionList<Trigger<?>, TriggerDescriptor> triggerDescriptors = Trigger.all();
for (TriggerDescriptor triggerDescriptor : triggerDescriptors) {
  String safeName = triggerDescriptor.getJsonSafeClassName();

相关文章