/** * Returns a list of all conversion configuration for the given format ({@link #getFormat()}). * * @return a list of all conversion configuration for the given format ({@link #getFormat()}). */ public List<String> getConvertConfiguration() { if (formatType == null) { return Collections.emptyList(); } return new ArrayList<>(formatType.getFormatConfigurations().getMap().keySet()); }
/** * Gets a Format Configuration instance corresponding to the given format configuration name. * * @param configuration a format configuration name. * @return a format configuration instance. */ public FormatConfigurationType getFormatConfigurationType(String configuration) { FormatConfigurationType formatConfigurationType = formatType.getFormatConfigurations().getMap().get(configuration); if (formatConfigurationType == null) { throw new ConversionException(String.format("No configuration '%s' found for format '%s'.", configuration, formatType.getName())); } return formatConfigurationType; }
@Test public void testParseCorrectConversion() throws Exception { ConversionXmlProvider conversionProvider = new ConversionXmlProvider(ConversionUtils.getCorrectConversionXml(), ConversionUtils.getCorrectConversionXmlPath(), new FakeFormat()); assertNotNull(conversionProvider.getFormat()); assertNotNull(conversionProvider.getFormat().getFormatConfigurations()); assertFalse(conversionProvider.getFormat().getFormatConfigurations().getMap().isEmpty()); }