• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AbstractItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中hudson.model.AbstractItem的典型用法代码示例。如果您正苦于以下问题:Java AbstractItem类的具体用法?Java AbstractItem怎么用?Java AbstractItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AbstractItem类属于hudson.model包,在下文中一共展示了AbstractItem类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getCredentials

import hudson.model.AbstractItem; //导入依赖的package包/类
public static BrowserStackCredentials getCredentials(final AbstractItem buildItem, final String credentialsId) {
    List<BrowserStackCredentials> available = availableCredentials(buildItem);
    if (available.isEmpty()) {
        return null;
    }

    CredentialsMatcher matcher;
    if (credentialsId != null) {
        matcher = CredentialsMatchers.allOf(CredentialsMatchers.withId(credentialsId));
    } else {
        matcher = CredentialsMatchers.always();
    }

    return CredentialsMatchers.firstOrDefault(
            available,
            matcher,
            available.get(0));
}
 
开发者ID:jenkinsci,项目名称:browserstack-integration-plugin,代码行数:19,代码来源:BrowserStackCredentials.java


示例2: findItemWithBuildWrapper

import hudson.model.AbstractItem; //导入依赖的package包/类
private static <T extends BuildWrapper> BuildWrapperItem<T> findItemWithBuildWrapper(final AbstractItem buildItem, Class<T> buildWrapperClass) {
    if (buildItem == null) {
        return null;
    }

    if (buildItem instanceof BuildableItemWithBuildWrappers) {
        BuildableItemWithBuildWrappers buildWrapper = (BuildableItemWithBuildWrappers) buildItem;
        DescribableList<BuildWrapper, Descriptor<BuildWrapper>> buildWrappersList = buildWrapper.getBuildWrappersList();

        if (buildWrappersList != null && !buildWrappersList.isEmpty()) {
            return new BuildWrapperItem<T>(buildWrappersList.get(buildWrapperClass), buildItem);
        }
    }

    if (buildItem.getParent() instanceof AbstractItem) {
        return findItemWithBuildWrapper((AbstractItem) buildItem.getParent(), buildWrapperClass);
    }

    return null;
}
 
开发者ID:jenkinsci,项目名称:browserstack-integration-plugin,代码行数:21,代码来源:BrowserStackBuildWrapper.java


示例3: AbstractScriptableParameter

import hudson.model.AbstractItem; //导入依赖的package包/类
/**
 * Inherited constructor.
 *
 * {@inheritDoc}
 *
 * @param name name
 * @param description description
 * @param randomName parameter random generated name (uuid)
 * @param script script used to generate the list of parameter values
 */
protected AbstractScriptableParameter(String name, String description, String randomName, Script script) {
    super(name, description, randomName);
    this.script = script;
    // Try to get the project name from the current request. In case of being called in some other non-web way,
    // the name will be fetched later via Jenkins.getInstance() and iterating through all items. This is for a
    // performance wise approach first.
    final StaplerRequest currentRequest = Stapler.getCurrentRequest();
    String projectName = null;
    if (currentRequest != null) {
        final Ancestor ancestor = currentRequest.findAncestor(AbstractItem.class);
        if (ancestor != null) {
            final Object o = ancestor.getObject();
            if (o instanceof AbstractItem) {
                final AbstractItem parentItem = (AbstractItem) o;
                projectName = parentItem.getName();
            }
        }
    }
    this.projectName = projectName;
}
 
开发者ID:imoutsatsos,项目名称:uno-choice-plugin,代码行数:31,代码来源:AbstractScriptableParameter.java


示例4: onLoad

import hudson.model.AbstractItem; //导入依赖的package包/类
@Override
public void onLoad(final ItemGroup<? extends Item> parent, final String name) throws IOException {
    try {
        final Field parentField = AbstractItem.class.getDeclaredField("parent");
        parentField.setAccessible(true);
        ReflectionUtils.setField(parentField, this, parent);
    } catch (final Exception e) {
        throw new RuntimeException(e);
    }

    doSetName(name);
    if (this.transientActions == null) {
        this.transientActions = new Vector<>();
    }
    updateTransientActions();
    getBuildersList().setOwner(this);
    getPublishersList().setOwner(this);
    getBuildWrappersList().setOwner(this);

    initRepos();
}
 
开发者ID:groupon,项目名称:DotCi,代码行数:22,代码来源:DynamicSubProject.java


示例5: availableCredentials

import hudson.model.AbstractItem; //导入依赖的package包/类
public static List<BrowserStackCredentials> availableCredentials(final AbstractItem abstractItem) {
    return CredentialsProvider.lookupCredentials(
            BrowserStackCredentials.class,
            abstractItem,
            null,
            new ArrayList<DomainRequirement>());
}
 
开发者ID:jenkinsci,项目名称:browserstack-integration-plugin,代码行数:8,代码来源:BrowserStackCredentials.java


示例6: getACL

import hudson.model.AbstractItem; //导入依赖的package包/类
/**
 * Tries to get the ACL of a folder.
 * Otherwise it will return the root ACL of the Authorization Strategy.
 * 
 * @param item the item
 * @return an ACL
 */
@Override
public ACL getACL(AbstractItem item) {
    if (item instanceof Folder) {
        return getACL((Folder) item);
    }
    return getRootACL();
}
 
开发者ID:enil,项目名称:gitlab-auth-plugin,代码行数:15,代码来源:GitLabAuthorization.java


示例7: getBaseClassLoader

import hudson.model.AbstractItem; //导入依赖的package包/类
/**
 * @return the {@link ClassLoader} on top of which to layer our restrictions.
 */
protected final ClassLoader getBaseClassLoader(RestrictedProject project) {
  // Search the project's parent hierarchy for additional
  // restricted projects on which to base our restrictions.
  ItemGroup parent = project.asProject().getParent();
  while (parent != null) {
    if (parent instanceof RestrictedProject) {
      final RestrictedProject parentProject = (RestrictedProject) parent;
      return parentProject.getRestriction().getClassLoader(parentProject);
    }
    if (!(parent instanceof AbstractItem)) {
      break;
    }
    parent = ((AbstractItem) parent).getParent();
  }

  // If no parents of this are restricted, then base things on the
  // unrestricted uber class loader.
  // NOTE: we wrap this class loader anyways to surface diagnostics
  // when there are actual class loading failures, so we can surface
  // them to the user.
  final ClassLoader base =
      checkNotNull(Jenkins.getInstance()).getPluginManager().uberClassLoader;
  return new ClassLoader() {
    @Override
    public Class loadClass(String name) throws ClassNotFoundException {
      try {
        return base.loadClass(name);
      } catch (ClassNotFoundException e) {
        throw new BadTypeException(
            Messages.AbstractRestriction_ClassNotFound(name));
      }
    }
  };
}
 
开发者ID:jenkinsci,项目名称:yaml-project-plugin,代码行数:38,代码来源:AbstractRestriction.java


示例8: DonutProjectAction

import hudson.model.AbstractItem; //导入依赖的package包/类
public DonutProjectAction(AbstractItem item) {
    super();
    this.item = item;
}
 
开发者ID:DonutReport,项目名称:donut-jenkins-plugin,代码行数:5,代码来源:DonutProjectAction.java


示例9: getProjectArchiveDir

import hudson.model.AbstractItem; //导入依赖的package包/类
private File getProjectArchiveDir(AbstractItem item) {
    return new File(item.getRootDir(), "donut");
}
 
开发者ID:DonutReport,项目名称:donut-jenkins-plugin,代码行数:4,代码来源:DonutProjectAction.java


示例10: BuildWrapperItem

import hudson.model.AbstractItem; //导入依赖的package包/类
BuildWrapperItem(T buildWrapper, AbstractItem buildItem) {
    this.buildWrapper = buildWrapper;
    this.buildItem = buildItem;
}
 
开发者ID:jenkinsci,项目名称:browserstack-integration-plugin,代码行数:5,代码来源:BrowserStackBuildWrapper.java


示例11: getProjectArchiveDir

import hudson.model.AbstractItem; //导入依赖的package包/类
/**
 * Gets the directory where the HTML report is stored for the given project.
 */
private File getProjectArchiveDir(AbstractItem project) {
    return new File(new File(project.getRootDir(), "htmlreports"), 
    		this.getSanitizedName());
}
 
开发者ID:Spirent,项目名称:Spirent-iTest-Jenkins-Plugin,代码行数:8,代码来源:Report.java


示例12: HTMLAction

import hudson.model.AbstractItem; //导入依赖的package包/类
public HTMLAction(AbstractItem project,
		Report actualHtmlPublisherTarget) {
    super(actualHtmlPublisherTarget);
    this.project = project;
}
 
开发者ID:Spirent,项目名称:Spirent-iTest-Jenkins-Plugin,代码行数:6,代码来源:Report.java


示例13: restoreName

import hudson.model.AbstractItem; //导入依赖的package包/类
@PostLoad
private void restoreName(final DBObject dbObj) {
    GReflectionUtils.setField(AbstractItem.class, "name", this, dbObj.get("name"));
}
 
开发者ID:groupon,项目名称:DotCi,代码行数:5,代码来源:DbBackedProject.java



注:本文中的hudson.model.AbstractItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PerspectiveAdapter类代码示例发布时间:2022-05-22
下一篇:
Java ResourceRequestProtoOrBuilder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap