/** * Alias for {@link #getDescriptor(String)}. */ public Descriptor getDescriptorByName(String id) { return getDescriptor(id); }
/** * Alias for {@link #getDescriptor(String)}. */ public Descriptor getDescriptorByName(String id) { return getDescriptor(id); }
/** * Alias for {@link #getDescriptor(String)}. */ public Descriptor getDescriptorByName(String id) { return getDescriptor(id); }
/** * Returns the descriptor of {@link SubversionSCM}. */ public SubversionSCM.DescriptorImpl getSubversionSCMDescriptor() { if (scmDescriptor == null) { scmDescriptor = (SubversionSCM.DescriptorImpl) Hudson.getInstance().getDescriptor(SubversionSCM.class); } return scmDescriptor; } }
/** * {@inheritDoc} */ @Override public TeamForgeShareDescriptor getDescriptor() { return (TeamForgeShareDescriptor)Hudson.getInstance(). getDescriptor(getClass()); }
/** * Creates a new job. * * <p> * This version infers the descriptor from the type of the top-level item. * * @throws IllegalArgumentException * if the project of the given name already exists. */ public synchronized <T extends TopLevelItem> T createProject(Class<T> type, String name) throws IOException { return type.cast(createProject((TopLevelItemDescriptor) getDescriptor(type), name)); }
/** * Creates a new job. * * <p> * This version infers the descriptor from the type of the top-level item. * * @throws IllegalArgumentException * if the project of the given name already exists. */ public synchronized <T extends TopLevelItem> T createProject(Class<T> type, String name) throws IOException { return type.cast(createProject((TopLevelItemDescriptor) getDescriptor(type), name)); }
/** * Returns the descriptor of {@link SubversionSCM}. */ public SubversionSCM.DescriptorImpl getSubversionSCMDescriptor() { if(scmDescriptor == null) { scmDescriptor = (SubversionSCM.DescriptorImpl) Hudson.getInstance().getDescriptor(SubversionSCM.class); } return scmDescriptor; }
@Override public Descriptor<ComputerLauncher> getDescriptor() { return Hudson.getInstance().getDescriptor(ManagedWindowsServiceLauncher.class); } };
/** * Static version of the above getDescriptor method. The above can't * be static because it's inherited. */ public static TeamForgeShareDescriptor getTeamForgeShareDescriptor() { return (TeamForgeShareDescriptor)Hudson.getInstance(). getDescriptor(TeamForgeShare.class); }
/** * Creates a new job. * * <p> * This version infers the descriptor from the type of the top-level item. * * @throws IllegalArgumentException if the project of the given name already * exists. */ public synchronized <T extends TopLevelItem> T createProject(Class<T> type, String name) throws IOException { return type.cast(createProject((TopLevelItemDescriptor) getDescriptor(type), name)); }
private static void readItem(StaplerRequest req, JSONObject obj, List<SCM> dest) throws FormException { String staplerClass = obj.getString("stapler-class"); Descriptor<SCM> d = (Descriptor<SCM>) Hudson.getInstance().getDescriptor(staplerClass); dest.add(d.newInstance(req, obj)); } }
@SuppressWarnings("unchecked") public ArrayList<Descriptor<IvyBuilderType>> getBuilderTypeDescriptors() { ArrayList<Descriptor<IvyBuilderType>> buildTypeDescriptors = new ArrayList<Descriptor<IvyBuilderType>>(); buildTypeDescriptors.add(Hudson.getInstance().getDescriptor(AntIvyBuilderType.class)); if (Hudson.getInstance().getPlugin("nant") != null) { buildTypeDescriptors.add(Hudson.getInstance().getDescriptor(NAntIvyBuilderType.class)); } return buildTypeDescriptors; }
/** * Tells Hudson that the help file for the field 'fieldName' is defined in * the help file for the 'fieldNameToRedirectTo' in the 'owner' class. * * @since 1.425 */ protected void addHelpFileRedirect(String fieldName, Class<? extends Describable> owner, String fieldNameToRedirectTo) { helpRedirect.put(fieldName, Hudson.getInstance().getDescriptor(owner).getHelpFile(fieldNameToRedirectTo)); }
private boolean isCreateAccountBasedOnEmail() { Hudson hudson = Hudson.getInstance(); if (hudson == null) { return false; } DescriptorImpl descriptor = (DescriptorImpl) hudson.getDescriptor(GitSCM.class); if (descriptor == null) { return false; } return descriptor.isCreateAccountBasedOnEmail(); }
/** * Returns {@link Descriptor} whose 'clazz' is the same as {@link #getItemType() the item type}. */ public Descriptor getItemTypeDescriptor() { return Hudson.getInstance().getDescriptor(getItemType()); }
/** * Returns the list of {@link org.jfrog.hudson.ArtifactoryServer} configured. * * @return can be empty but never null. */ public static List<ArtifactoryServer> getArtifactoryServers() { ArtifactoryBuilder.DescriptorImpl descriptor = (ArtifactoryBuilder.DescriptorImpl) Hudson.getInstance().getDescriptor(ArtifactoryBuilder.class); return descriptor.getArtifactoryServers(); }
/** * Returns {@link Descriptor} whose 'clazz' is the same as {@link #getItemType() the item type}. */ public Descriptor getItemTypeDescriptor() { return Hudson.getInstance().getDescriptor(getItemType()); }
public Object call() throws Exception { Descriptor d = hudson.getDescriptor(type); WebClient wc = createWebClient(); for (String property : listProperties(properties)) { String url = d.getHelpFile(property); assertNotNull("Help file for the property "+property+" is missing on "+type, url); wc.goTo(url); // make sure it successfully loads } return null; } });
/** * Since this shares much of the configuration with {@link EC2Computer}, check its help page, too. */ @Override public String getHelpFile(String fieldName) { String p = super.getHelpFile(fieldName); if (p==null) p = Hudson.getInstance().getDescriptor(EC2OndemandSlave.class).getHelpFile(fieldName); if (p==null) p = Hudson.getInstance().getDescriptor(EC2SpotSlave.class).getHelpFile(fieldName); return p; }