本文整理了Java中hudson.model.TopLevelItem.getDescriptor()
方法的一些代码示例,展示了TopLevelItem.getDescriptor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TopLevelItem.getDescriptor()
方法的具体详情如下:
包路径:hudson.model.TopLevelItem
类名称:TopLevelItem
方法名:getDescriptor
暂无
代码示例来源: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/jenkins
success = acl.getACL().hasCreatePermission(Jenkins.getAuthentication(), parent, result.getDescriptor())
&& result.getDescriptor().isApplicableIn(parent);
代码示例来源:origin: jenkinsci/jenkins
src.getDescriptor().checkApplicableIn(parent);
acl.getACL().checkCreatePermission(parent, src.getDescriptor());
ItemListener.checkBeforeCopy(src, parent);
T result = (T)createProject(src.getDescriptor(),name,false);
代码示例来源:origin: jenkinsci/jenkins
int counts[] = new int[descriptors.length];
for (TopLevelItem item: j.allItems(TopLevelItem.class)) {
TopLevelItemDescriptor d = item.getDescriptor();
for (int i = 0; i < descriptors.length; i++) {
if (d == descriptors[i]) {
代码示例来源:origin: org.eclipse.hudson/hudson-core
@Override
public TopLevelItemDescriptor getDescriptor() {
return item().getDescriptor();
}
代码示例来源: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.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/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
success = acl.getACL().hasCreatePermission(Jenkins.getAuthentication(), parent, result.getDescriptor())
&& result.getDescriptor().isApplicableIn(parent);
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
int cnt = 0;
for (TopLevelItem item : items) {
if (item.getDescriptor() == d) {
cnt++;
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
src.getDescriptor().checkApplicableIn(parent);
acl.getACL().checkCreatePermission(parent, src.getDescriptor());
ItemListener.checkBeforeCopy(src, parent);
T result = (T)createProject(src.getDescriptor(),name,false);
代码示例来源:origin: hudson/hudson-2.x
int cnt = 0;
for (TopLevelItem item : items) {
if (item.getDescriptor() == d) {
cnt++;
代码示例来源:origin: org.eclipse.hudson/hudson-core
int cnt = 0;
for (TopLevelItem item : items) {
if (item.getDescriptor() == d) {
cnt++;
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
int cnt = 0;
for (TopLevelItem item : items) {
if (item.getDescriptor() == d) {
cnt++;
代码示例来源:origin: hudson/hudson-2.x
/**
* Copies an existing {@link TopLevelItem} to a new name.
*
* The caller is responsible for calling {@link ItemListener#fireOnCopied(Item, Item)}. This method
* cannot do that because it doesn't know how to make the newly added item reachable from the parent.
*/
@SuppressWarnings({"unchecked"})
public synchronized <T extends TopLevelItem> T copy(T src, String name) throws IOException {
acl.checkPermission(Job.CREATE);
T result = (T)createProject(src.getDescriptor(),name,false);
// copy config
Util.copyFile(Items.getConfigFile(src).getFile(),Items.getConfigFile(result).getFile());
// reload from the new config
result = (T)Items.load(parent,result.getRootDir());
result.onCopiedFrom(src);
add(result);
ItemListener.fireOnCopied(src,result);
return result;
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
acl.checkPermission(Job.CREATE);
T result = (T) createProject(src.getDescriptor(), name, teamName, false);
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Copies an existing {@link TopLevelItem} to a new name.
*
* The caller is responsible for calling {@link ItemListener#fireOnCopied(Item, Item)}. This method
* cannot do that because it doesn't know how to make the newly added item reachable from the parent.
*/
@SuppressWarnings({"unchecked"})
public synchronized <T extends TopLevelItem> T copy(T src, String name) throws IOException {
acl.checkPermission(Job.CREATE);
T result = (T)createProject(src.getDescriptor(),name,false);
// copy config
Util.copyFile(Items.getConfigFile(src).getFile(),Items.getConfigFile(result).getFile());
// reload from the new config
result = (T)Items.load(parent,result.getRootDir());
result.onCopiedFrom(src);
add(result);
ItemListener.fireOnCopied(src,result);
return result;
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Copies an existing {@link TopLevelItem} to a new name.
*
* The caller is responsible for calling {@link ItemListener#fireOnCopied(Item, Item)}. This method
* cannot do that because it doesn't know how to make the newly added item reachable from the parent.
*/
@SuppressWarnings({"unchecked"})
public synchronized <T extends TopLevelItem> T copy(T src, String name) throws IOException {
acl.checkPermission(Job.CREATE);
T result = (T)createProject(src.getDescriptor(),name,false);
// copy config
Util.copyFile(Items.getConfigFile(src).getFile(),Items.getConfigFile(result).getFile());
// reload from the new config
result = (T)Items.load(parent,result.getRootDir());
result.onCopiedFrom(src);
add(result);
ItemListener.fireOnCopied(src,result);
return result;
}
内容来源于网络,如有侵权,请联系作者删除!