@Override public FolderProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException { return (FolderProperty) super.newInstance(req, formData); }
/** * Properties that can be configured for this type of {@link AbstractFolder} subtype. * * @return the property descriptors. */ public List<AbstractFolderPropertyDescriptor> getPropertyDescriptors() { return AbstractFolderPropertyDescriptor.getApplicableDescriptors(clazz.asSubclass(AbstractFolder.class)); }
/** * Gets the {@link FolderPropertyDescriptor}s applicable for a given folder type. * * @param containerType the type of folder. * @return the applicable descriptors. */ @SuppressWarnings("rawtypes") // erasure public static List<AbstractFolderPropertyDescriptor> getApplicableDescriptors(Class<? extends AbstractFolder> containerType) { List<AbstractFolderPropertyDescriptor> r = new ArrayList<AbstractFolderPropertyDescriptor>(); for (AbstractFolderPropertyDescriptor p : ExtensionList.lookup(AbstractFolderPropertyDescriptor.class)) { if (p.isApplicable(containerType)) { r.add(p); } } return r; }
/** * Gets the {@link FolderPropertyDescriptor}s applicable for a given folder type. * * @param containerType the type of folder. * @return the applicable descriptors. */ @SuppressWarnings("rawtypes") // erasure public static List<AbstractFolderPropertyDescriptor> getApplicableDescriptors(Class<? extends AbstractFolder> containerType) { List<AbstractFolderPropertyDescriptor> r = new ArrayList<AbstractFolderPropertyDescriptor>(); for (AbstractFolderPropertyDescriptor p : ExtensionList.lookup(AbstractFolderPropertyDescriptor.class)) { if (p.isApplicable(containerType)) { r.add(p); } } return r; }
@Override public FolderProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException { return (FolderProperty) super.newInstance(req, formData); }
@SuppressWarnings("rawtypes") // else setOwner will not compile public void addProperty(AbstractFolderProperty p) throws IOException { if (!p.getDescriptor().isApplicable(getClass())) { throw new IllegalArgumentException(p.getClass().getName() + " cannot be applied to " + getClass().getName()); } p.setOwner(this); properties.add(p); }
/** * Properties that can be configured for this type of {@link AbstractFolder} subtype. * * @return the property descriptors. */ public List<AbstractFolderPropertyDescriptor> getPropertyDescriptors() { return AbstractFolderPropertyDescriptor.getApplicableDescriptors(clazz.asSubclass(AbstractFolder.class)); }
@Override public AbstractFolderProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException { FolderLibraries prop = (FolderLibraries) super.newInstance(req, formData); return prop.libraries.isEmpty() ? null : prop; }
@SuppressWarnings("rawtypes") // else setOwner will not compile public void addProperty(AbstractFolderProperty p) throws IOException { if (!p.getDescriptor().isApplicable(getClass())) { throw new IllegalArgumentException(p.getClass().getName() + " cannot be applied to " + getClass().getName()); } p.setOwner(this); properties.add(p); }
@Override public AbstractFolderProperty<?> reconfigure(StaplerRequest req, JSONObject form) throws Descriptor.FormException { return form == null ? null : getDescriptor().newInstance(req, form); }
@Override public AbstractFolderProperty<?> reconfigure(StaplerRequest req, JSONObject form) throws Descriptor.FormException { return form == null ? null : getDescriptor().newInstance(req, form); }