/** * Returns the list of {@link RepositoryBrowser} {@link Descriptor} * that can be used with this SCM. * * @return * can be empty but never null. */ public List<Descriptor<RepositoryBrowser<?>>> getBrowserDescriptors() { if(repositoryBrowser==null) return Collections.emptyList(); return RepositoryBrowsers.filter(repositoryBrowser); }
/** * Creates an instance of {@link RepositoryBrowser} from a form submission. * * @deprecated since 2008-06-19. * Use {@link #createInstance(Class, StaplerRequest, JSONObject, String)}. */ @Deprecated public static <T extends RepositoryBrowser> T createInstance(Class<T> type, StaplerRequest req, String fieldName) throws FormException { List<Descriptor<RepositoryBrowser<?>>> list = filter(type); String value = req.getParameter(fieldName); if(value==null || value.equals("auto")) return null; // TODO: There was a TODO in the original code, which presumes passing something meaningful to the newInstance() JSON param // Now we just pass empty JSON in order to make the code compliant with the defined interface final JSONObject emptyJSON = new JSONObject(); return type.cast(list.get(Integer.parseInt(value)).newInstance(req, emptyJSON)); }
/** * Returns the list of {@link RepositoryBrowser} {@link Descriptor} * that can be used with this SCM. * * @return * can be empty but never null. */ public List<Descriptor<RepositoryBrowser<?>>> getBrowserDescriptors() { if(repositoryBrowser==null) return Collections.emptyList(); return RepositoryBrowsers.filter(repositoryBrowser); }
/** * Returns the list of {@link RepositoryBrowser} {@link Descriptor} * that can be used with this SCM. * * @return * can be empty but never null. */ public List<Descriptor<RepositoryBrowser<?>>> getBrowserDescriptors() { if(repositoryBrowser==null) return Collections.emptyList(); return RepositoryBrowsers.filter(repositoryBrowser); }
/** * Returns the list of {@link RepositoryBrowser} {@link Descriptor} * that can be used with this SCM. * * @return * can be empty but never null. */ public List<Descriptor<RepositoryBrowser<?>>> getBrowserDescriptors() { if(repositoryBrowser==null) return Collections.emptyList(); return RepositoryBrowsers.filter(repositoryBrowser); }
/** * Returns the list of {@link RepositoryBrowser} {@link Descriptor} * that can be used with this SCM. * * @return * can be empty but never null. */ public List<Descriptor<RepositoryBrowser<?>>> getBrowserDescriptors() { if(repositoryBrowser==null) return Collections.emptyList(); return RepositoryBrowsers.filter(repositoryBrowser); }
/** * Returns the list of {@link RepositoryBrowser} {@link Descriptor} that can * be used with this SCM. * * @return can be empty but never null. */ public List<Descriptor<RepositoryBrowser<?>>> getBrowserDescriptors() { if (repositoryBrowser == null) { return Collections.emptyList(); } return RepositoryBrowsers.filter(repositoryBrowser); } private static final Logger LOGGER = Logger.getLogger(SCMDescriptor.class.getName());
/** * Expose the {@link HgBrowser} instances to stapler. * * @return the {@link HgBrowser} instances */ @Restricted(NoExternalUse.class) // stapler public List<Descriptor<RepositoryBrowser<?>>> getBrowserDescriptors() { return RepositoryBrowsers.filter(HgBrowser.class); }
/** * Creates an instance of {@link RepositoryBrowser} from a form submission. * * @deprecated since 2008-06-19. * Use {@link #createInstance(Class, StaplerRequest, JSONObject, String)}. */ public static <T extends RepositoryBrowser> T createInstance(Class<T> type, StaplerRequest req, String fieldName) throws FormException { List<Descriptor<RepositoryBrowser<?>>> list = filter(type); String value = req.getParameter(fieldName); if(value==null || value.equals("auto")) return null; return type.cast(list.get(Integer.parseInt(value)).newInstance(req,null/*TODO*/)); }
/** * Creates an instance of {@link RepositoryBrowser} from a form submission. * * @deprecated since 2008-06-19. * Use {@link #createInstance(Class, StaplerRequest, JSONObject, String)}. */ public static <T extends RepositoryBrowser> T createInstance(Class<T> type, StaplerRequest req, String fieldName) throws FormException { List<Descriptor<RepositoryBrowser<?>>> list = filter(type); String value = req.getParameter(fieldName); if(value==null || value.equals("auto")) return null; return type.cast(list.get(Integer.parseInt(value)).newInstance(req,null/*TODO*/)); }
/** * Creates an instance of {@link RepositoryBrowser} from a form submission. * * @deprecated since 2008-06-19. * Use {@link #createInstance(Class, StaplerRequest, JSONObject, String)}. */ public static <T extends RepositoryBrowser> T createInstance(Class<T> type, StaplerRequest req, String fieldName) throws FormException { List<Descriptor<RepositoryBrowser<?>>> list = filter(type); String value = req.getParameter(fieldName); if(value==null || value.equals("auto")) return null; return type.cast(list.get(Integer.parseInt(value)).newInstance(req,null/*TODO*/)); }
/** * Creates an instance of {@link RepositoryBrowser} from a form submission. * * @deprecated since 2008-06-19. Use * {@link #createInstance(Class, StaplerRequest, JSONObject, String)}. */ public static <T extends RepositoryBrowser> T createInstance(Class<T> type, StaplerRequest req, String fieldName) throws FormException { List<Descriptor<RepositoryBrowser<?>>> list = filter(type); String value = req.getParameter(fieldName); if (value == null || value.equals("auto")) { return null; } return type.cast(list.get(Integer.parseInt(value)).newInstance(req, null/*TODO*/)); }
@Deprecated @Restricted(DoNotUse.class) @RestrictedSince("2.0") public List<Descriptor<RepositoryBrowser<?>>> getBrowserDescriptors() { return RepositoryBrowsers.filter(HgBrowser.class); }
/** * Creates an instance of {@link RepositoryBrowser} from a form submission. * * @deprecated since 2008-06-19. * Use {@link #createInstance(Class, StaplerRequest, JSONObject, String)}. */ @Deprecated public static <T extends RepositoryBrowser> T createInstance(Class<T> type, StaplerRequest req, String fieldName) throws FormException { List<Descriptor<RepositoryBrowser<?>>> list = filter(type); String value = req.getParameter(fieldName); if(value==null || value.equals("auto")) return null; // TODO: There was a TODO in the original code, which presumes passing something meaningful to the newInstance() JSON param // Now we just pass empty JSON in order to make the code compliant with the defined interface final JSONObject emptyJSON = new JSONObject(); return type.cast(list.get(Integer.parseInt(value)).newInstance(req, emptyJSON)); }