@Test public void testBasicWithConfiguration() { RequiredPropertyConstructorExtension extension = new RequiredPropertyConstructorExtension(); Map<String, String> configuration = new HashMap<>(); String classes = SimpleClass.class.getCanonicalName() + " " + OtherClass.class.getCanonicalName(); configuration.put(RequiredPropertyConstructorExtension.CFG_CLASSES, classes); extension.setConfiguration(configuration); Settings settings = createBaseSettings(extension); settings.declarePropertiesAsReadOnly = true; String result = generateTypeScript(settings, SimpleClass.class, OtherClass.class); String expected = readResource("basicWithConfiguration.ts"); Assert.assertEquals(expected, result); }
@Override public void setConfiguration(Map<String, String> configuration) throws RuntimeException { if (configuration.containsKey(CFG_CLASSES)) { classes = Arrays.asList(Pattern.compile("\\s+").split(configuration.get(CFG_CLASSES))); } }
RequiredPropertyConstructorExtension extends Extension { @Override public void setConfiguration(Map<String, String> configuration) throws RuntimeException { if (configuration.containsKey(CFG_CLASSES)) { classes = Arrays.asList(Pattern.compile("\\s+").split(configuration.get(CFG_CLASSES))); } } }
RequiredPropertyConstructorExtension extends Extension { @Override public void setConfiguration(Map<String, String> configuration) throws RuntimeException { if (configuration.containsKey(CFG_CLASSES)) { classes = Arrays.asList(Pattern.compile("\\s+").split(configuration.get(CFG_CLASSES))); } }  }
RequiredPropertyConstructorExtension extends Extension { @Override public void setConfiguration(Map<String, String> configuration) throws RuntimeException { if (configuration.containsKey(CFG_CLASSES)) { classes = Arrays.asList(Pattern.compile("\\s+").split(configuration.get(CFG_CLASSES))); } }  @Override EmitterExtensionFeatures getFeatures(); @Override void setConfiguration(Map<String, String> configuration); @Override List<TransformerDefinition> getTransformers(); }
RequiredPropertyConstructorExtension extends Extension { @Override public void setConfiguration(Map<String, String> configuration) throws RuntimeException { if (configuration.containsKey(CFG_CLASSES)) { classes = Arrays.asList(Pattern.compile("\\s+").split(configuration.get(CFG_CLASSES))); } }  @Override EmitterExtensionFeatures getFeatures(); @Override void setConfiguration(Map<String, String> configuration); @Override List<TransformerDefinition> getTransformers();  }