/** * Determines if the requested format is supported * * @param format * the requested exporter format * @return <code>true</code> if the format is supported */ public boolean isFormatSupported(final String format) { return !getMatchingFactories(format).isEmpty(); } }
/** * Determines if the requested format is supported * * @param format * the requested exporter format * @return <code>true</code> if the format is supported */ public boolean isFormatSupported(final String format) { return !getMatchingFactories(format).isEmpty(); } }
/** * Finds a matching {@link ExporterFactory} that can handle the given output * format. If no or more than one {@link ExporterFactory} is found, this * throws an {@link ExporterException}. * * @param outputFormat * the output format for which to get a {@link ExporterFactory}. * @return a matching {@link ExporterFactory} that can handle the given * output format * @throws ExporterException * when no or more than one {@link ExporterFactory} is found. */ public ExporterFactory getExporterFactory(final String outputFormat) { final List<ExporterFactory> matchingExporters = getMatchingFactories(outputFormat); switch (matchingExporters.size()) { case 0: throw new ExporterException( "Found no matching exporter for output format '" + outputFormat + "'"); case 1: return matchingExporters.get(0); default: throw new ExporterException("Found more than one matching exporter for output format '" + outputFormat + "'"); } }
/** * Finds a matching {@link ExporterFactory} that can handle the given output * format. If no or more than one {@link ExporterFactory} is found, this * throws an {@link ExporterException}. * * @param outputFormat * the output format for which to get a {@link ExporterFactory}. * @return a matching {@link ExporterFactory} that can handle the given * output format * @throws ExporterException * when no or more than one {@link ExporterFactory} is found. */ public ExporterFactory getExporterFactory(final String outputFormat) { final List<ExporterFactory> matchingExporters = getMatchingFactories(outputFormat); switch (matchingExporters.size()) { case 0: throw new ExporterException( "Found no matching exporter for output format '" + outputFormat + "'"); case 1: return matchingExporters.get(0); default: throw new ExporterException("Found more than one matching exporter for output format '" + outputFormat + "'"); } }