/** * 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; }
@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); }
@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); }