/** * Specify that the property is a type-safe <code>List</code>. * * @param property * name of the JavaBean property * @param type * class of List values */ @Deprecated public void putListPropertyType(String property, Class<? extends Object> type) { addPropertyParameters(property, type); }
/** * Specify that the property is a type-safe <code>Map</code>. * * @param property * property name of this JavaBean * @param key * class of keys in Map * @param value * class of values in Map */ @Deprecated public void putMapPropertyType(String property, Class<? extends Object> key, Class<? extends Object> value) { addPropertyParameters(property, key, value); }
private static <T> T parseObject(String rawConfig) { Constructor constructor = new Constructor(ConfiguratorConfig.class); TypeDescription itemDescription = new TypeDescription(ConfiguratorConfig.class); itemDescription.addPropertyParameters("items", ConfigItem.class); constructor.addTypeDescription(itemDescription); Yaml yaml = new Yaml(constructor); return yaml.load(rawConfig); }
private static <T> T parseObject(String rawConfig) { Constructor constructor = new Constructor(ConfiguratorConfig.class); TypeDescription itemDescription = new TypeDescription(ConfiguratorConfig.class); itemDescription.addPropertyParameters("items", ConfigItem.class); constructor.addTypeDescription(itemDescription); Yaml yaml = new Yaml(constructor); return yaml.load(rawConfig); }
suiteDescription.addPropertyParameters("packages", XmlPackage.class); suiteDescription.addPropertyParameters("listeners", String.class); suiteDescription.addPropertyParameters("tests", XmlTest.class); suiteDescription.addPropertyParameters("method-selectors", XmlMethodSelector.class); constructor.addTypeDescription(suiteDescription); testDescription.addPropertyParameters("classes", XmlClass.class); testDescription.addPropertyParameters("metaGroups", String.class, List.class); testDescription.addPropertyParameters("method-selectors", XmlMethodSelector.class); constructor.addTypeDescription(testDescription);
public static TagRouterRule parse(String rawRule) { Constructor constructor = new Constructor(TagRouterRule.class); TypeDescription tagDescription = new TypeDescription(TagRouterRule.class); tagDescription.addPropertyParameters("tags", Tag.class); constructor.addTypeDescription(tagDescription); Yaml yaml = new Yaml(constructor); TagRouterRule rule = yaml.load(rawRule); rule.setRawRule(rawRule); if (CollectionUtils.isEmpty(rule.getTags())) { rule.setValid(false); } rule.init(); return rule; } }
public static TagRouterRule parse(String rawRule) { Constructor constructor = new Constructor(TagRouterRule.class); TypeDescription tagDescription = new TypeDescription(TagRouterRule.class); tagDescription.addPropertyParameters("tags", Tag.class); constructor.addTypeDescription(tagDescription); Yaml yaml = new Yaml(constructor); TagRouterRule rule = yaml.load(rawRule); rule.setRawRule(rawRule); if (CollectionUtils.isEmpty(rule.getTags())) { rule.setValid(false); } rule.init(); return rule; } }
/** * Specify that the property is a type-safe <code>List</code>. * * @param property * name of the JavaBean property * @param type * class of List values */ @Deprecated public void putListPropertyType(String property, Class<? extends Object> type) { addPropertyParameters(property, type); }
/** * Specify that the property is a type-safe <code>Map</code>. * * @param property * property name of this JavaBean * @param key * class of keys in Map * @param value * class of values in Map */ @Deprecated public void putMapPropertyType(String property, Class<? extends Object> key, Class<? extends Object> value) { addPropertyParameters(property, key, value); }
private static <T> T parseObject(String rawConfig) { Constructor constructor = new Constructor(ConfiguratorConfig.class); TypeDescription itemDescription = new TypeDescription(ConfiguratorConfig.class); itemDescription.addPropertyParameters("items", ConfigItem.class); constructor.addTypeDescription(itemDescription); Yaml yaml = new Yaml(constructor); return yaml.load(rawConfig); }
private static <T> T parseObject(String rawConfig) { Constructor constructor = new Constructor(ConfiguratorConfig.class); TypeDescription itemDescription = new TypeDescription(ConfiguratorConfig.class); itemDescription.addPropertyParameters("items", ConfigItem.class); constructor.addTypeDescription(itemDescription); Yaml yaml = new Yaml(constructor); return yaml.load(rawConfig); }
protected Yaml getCustomYaml() { SnakeYamlCharmer charmer = new SnakeYamlCharmer(RawStmtsDoc.class); charmer.addHandler(StatementsOwner.class, "statements", new StatementsReader()); charmer.addHandler(StatementsOwner.class, "statement", new StatementsReader()); TypeDescription tds = new TypeDescription(RawStmtsDoc.class); tds.addPropertyParameters("blocks", RawStmtsBlock.class); charmer.addTypeDescription(tds); return new Yaml(charmer); }
public static TagRouterRule parse(String rawRule) { Constructor constructor = new Constructor(TagRouterRule.class); TypeDescription tagDescription = new TypeDescription(TagRouterRule.class); tagDescription.addPropertyParameters("tags", Tag.class); constructor.addTypeDescription(tagDescription); Yaml yaml = new Yaml(constructor); TagRouterRule rule = yaml.load(rawRule); rule.setRawRule(rawRule); if (CollectionUtils.isEmpty(rule.getTags())) { rule.setValid(false); } rule.init(); return rule; } }
public static TagRouterRule parse(String rawRule) { Constructor constructor = new Constructor(TagRouterRule.class); TypeDescription tagDescription = new TypeDescription(TagRouterRule.class); tagDescription.addPropertyParameters("tags", Tag.class); constructor.addTypeDescription(tagDescription); Yaml yaml = new Yaml(constructor); TagRouterRule rule = yaml.load(rawRule); rule.setRawRule(rawRule); if (CollectionUtils.isEmpty(rule.getTags())) { rule.setValid(false); } rule.init(); return rule; } }