/** * Create the {@link Yaml} instance to use. * <p>The default implementation sets the "allowDuplicateKeys" flag to {@code false}, * enabling built-in duplicate key handling in SnakeYAML 1.18+. * @see LoaderOptions#setAllowDuplicateKeys(boolean) */ protected Yaml createYaml() { LoaderOptions options = new LoaderOptions(); options.setAllowDuplicateKeys(false); return new Yaml(options); }
/** * Create Yaml instance. It is safe to create a few instances and use them * in different Threads. * * @param constructor * BaseConstructor to construct incoming documents * @param representer * Representer to emit outgoing objects * @param dumperOptions * DumperOptions to configure outgoing objects * @param resolver * Resolver to detect implicit type */ public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions, Resolver resolver) { this(constructor, representer, dumperOptions, new LoaderOptions(), resolver); }
this.constructor.setAllowDuplicateKeys(loadingConfig.isAllowDuplicateKeys()); if (dumperOptions.getIndent() <= dumperOptions.getIndicatorIndent()) { throw new YAMLException("Indicator indent must be smaller then indent.");
/** * Create Yaml instance. It is safe to create a few instances and use them * in different Threads. * * @param constructor * BaseConstructor to construct incoming documents * @param representer * Representer to emit outgoing objects * @param dumperOptions * DumperOptions to configure outgoing objects */ public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions) { this(constructor, representer, dumperOptions, new LoaderOptions(), new Resolver()); }
this.constructor.setAllowDuplicateKeys(loadingConfig.isAllowDuplicateKeys()); if (dumperOptions.getIndent() <= dumperOptions.getIndicatorIndent()) { throw new YAMLException("Indicator indent must be smaller then indent.");
/** * Create the {@link Yaml} instance to use. * <p>The default implementation sets the "allowDuplicateKeys" flag to {@code false}, * enabling built-in duplicate key handling in SnakeYAML 1.18+. * @see LoaderOptions#setAllowDuplicateKeys(boolean) */ protected Yaml createYaml() { LoaderOptions options = new LoaderOptions(); options.setAllowDuplicateKeys(false); return new Yaml(options); }
/** * Create Yaml instance. It is safe to create a few instances and use them * in different Threads. * * @param representer * Representer to emit outgoing objects * @param dumperOptions * DumperOptions to configure outgoing objects */ public Yaml(Representer representer, DumperOptions dumperOptions) { this(new Constructor(), representer, dumperOptions, new LoaderOptions(), new Resolver()); }
@Override protected Yaml createYaml() { BaseConstructor constructor = new OriginTrackingConstructor(); Representer representer = new Representer(); DumperOptions dumperOptions = new DumperOptions(); LimitedResolver resolver = new LimitedResolver(); LoaderOptions loaderOptions = new LoaderOptions(); loaderOptions.setAllowDuplicateKeys(false); return new Yaml(constructor, representer, dumperOptions, loaderOptions, resolver); }
/** * Create Yaml instance. It is safe to create a few instances and use them * in different Threads. */ public Yaml() { this(new Constructor(), new Representer(), new DumperOptions(), new LoaderOptions(), new Resolver()); }
private void createYamlLoader() { LoaderOptions loaderOptions = new LoaderOptions(); loaderOptions.setAllowDuplicateKeys(validationProperties.isAllowDuplicates()); yaml = new Yaml(loaderOptions); }
/** * Create Yaml instance. It is safe to create a few instances and use them * in different Threads. * * @param constructor * BaseConstructor to construct incoming documents * @param representer * Representer to emit outgoing objects * @param dumperOptions * DumperOptions to configure outgoing objects * @param resolver * Resolver to detect implicit type */ public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions, Resolver resolver) { this(constructor, representer, dumperOptions, new LoaderOptions(), resolver); }
/** * Create Yaml instance. It is safe to create a few instances and use them * in different Threads. * * @param constructor * BaseConstructor to construct incoming documents * @param representer * Representer to emit outgoing objects * @param dumperOptions * DumperOptions to configure outgoing objects */ public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions) { this(constructor, representer, dumperOptions, new LoaderOptions(), new Resolver()); }
/** * Create Yaml instance. It is safe to create a few instances and use them * in different Threads. * * @param representer * Representer to emit outgoing objects * @param dumperOptions * DumperOptions to configure outgoing objects */ public Yaml(Representer representer, DumperOptions dumperOptions) { this(new Constructor(), representer, dumperOptions, new LoaderOptions(), new Resolver()); }
/** * Create Yaml instance. It is safe to create a few instances and use them * in different Threads. */ public Yaml() { this(new Constructor(), new Representer(), new DumperOptions(), new LoaderOptions(), new Resolver()); }