Java 类org.yaml.snakeyaml.emitter.ScalarAnalysis 实例源码

项目:yaml-project-plugin    文件:JsonToYaml.java   
/** {@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));
}
项目:TestTheTeacher    文件:DumperOptions.java   
/**
 * 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;
}
项目:org.openntf.domino    文件:DumperOptions.java   
/**
 * 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;
}