/** {@inheritDoc} */ @Override public String toYaml(InputStream inputStream) { DumperOptions options = new DumperOptions() { /** Force usage of PLAIN style */ @Override public DumperOptions.ScalarStyle calculateScalarStyle( ScalarAnalysis analysis, DumperOptions.ScalarStyle style) { return DumperOptions.ScalarStyle.PLAIN; } }; options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); // NOTE: This is inadequate, thus the above hack. options.setDefaultScalarStyle(DumperOptions.ScalarStyle.PLAIN); final Yaml yaml = new Yaml(new CustomRepresenter(transforms), options); return yaml.dump(yaml.load(inputStream)); }
/** * Define the ScalarStyle to be used for emitting scalars * * @param analysis * - Scalar meta data * @param style * - automatically detected style * @return ScalarStyle to be used for scalar * @deprecated it was implemented as a quick fix for issue 29 */ public ScalarStyle calculateScalarStyle(ScalarAnalysis analysis, ScalarStyle style) { return style; }
/** * Define the ScalarStyle to be used for emitting scalars * * @param analysis * - Scalar meta data * @param style * - automatically detected style * @return ScalarStyle to be used for scalar * @deprecated it was implemented as a quick fix for issue 29 */ @Deprecated public ScalarStyle calculateScalarStyle(final ScalarAnalysis analysis, final ScalarStyle style) { return style; }