Examples of Representer


Examples of org.jvyamlb.Representer

            iox = new IOOutputStream(io);
        }
        Serializer ser = new JRubySerializer(new EmitterImpl(iox,cfg),new ResolverImpl(),cfg);
        try {
            ser.open();
            Representer r = new JRubyRepresenter(ser, cfg);
            for(Iterator iter = objs.getList().iterator();iter.hasNext();) {
                r.represent(iter.next());
            }
            ser.close();
        } catch(IOException e) {
            throw self.getRuntime().newIOErrorFromException(e);
        }
View Full Code Here

Examples of org.yaml.snakeyaml.representer.Representer

public class ProvisionerProfileHelper {
  public static JProvisionerProfile fromFile(final File file) throws FileNotFoundException {
    if (file == null) {
      throw new FileNotFoundException("null obviously could not be found");
    }
    final Representer r = new Representer();
    r.getPropertyUtils().setSkipMissingProperties(true);
    final Yaml yaml = new Yaml(new CustomClassLoaderConstructor(JProvisionerProfile.class), r);
    final InputStream fis = new FileInputStream(file);
    JProvisionerProfile p = null;
    try {
      p = (JProvisionerProfile) yaml.load(fis);
View Full Code Here

Examples of org.yaml.snakeyaml.representer.Representer

        this.format = format;

        DumperOptions options = new FancyDumperOptions();
        options.setIndent(4);
        options.setDefaultFlowStyle(format.getStyle());
        Representer representer = new FancyRepresenter();
        representer.setDefaultFlowStyle(format.getStyle());

        yaml = new Yaml(new SafeConstructor(), representer, options);

        this.file = file;
    }
View Full Code Here

Examples of org.yaml.snakeyaml.representer.Representer

    this.yamlModel = yamlModel;
  }

  @Override
  public Yaml get() {
    Representer representer = new Representer();

    for (EtcKey key : yamlModel.keySet()) {
      representer.addClassTag(key.get(), Tag.MAP);
    }

    NaturalPropertyUtils propertyUtils = new NaturalPropertyUtils();
    representer.setPropertyUtils(propertyUtils);

    DumperOptions options = new DumperOptions();
    options.setDefaultFlowStyle(FlowStyle.BLOCK);

    return new org.yaml.snakeyaml.Yaml(
View Full Code Here

Examples of org.yaml.snakeyaml.representer.Representer

      return value;
   }

   protected List<?> loadYamlData(final Reader io) throws IOException {
      final Yaml yaml = new Yaml(new Constructor(), new Representer(),
            new DumperOptions(), new YamlParserResolver());
      final Object loadedYaml = yaml.load(io);

      if (loadedYaml instanceof ArrayList) {
         return (ArrayList<?>) loadedYaml;
View Full Code Here

Examples of org.yaml.snakeyaml.representer.Representer

      return value;
   }

   protected List<?> loadYamlData(final Reader io) throws IOException {
      final Yaml yaml = new Yaml(new Constructor(), new Representer(),
            new DumperOptions(), new YamlParserResolver());
      final Object loadedYaml = yaml.load(io);

      if (loadedYaml instanceof ArrayList) {
         return (ArrayList<?>) loadedYaml;
View Full Code Here

Examples of org.yaml.snakeyaml.representer.Representer

    this.yamlModel = yamlModel;
  }

  @Override
  public Yaml get() {
    Representer representer = new Representer();

    for (ConfigKey key : yamlModel.keySet()) {
      representer.addClassTag(key.get(), Tag.MAP);
    }

    NaturalPropertyUtils propertyUtils = new NaturalPropertyUtils();
    representer.setPropertyUtils(propertyUtils);

    DumperOptions options = new DumperOptions();
    options.setDefaultFlowStyle(FlowStyle.BLOCK);

    return new org.yaml.snakeyaml.Yaml(
View Full Code Here

Examples of org.yaml.snakeyaml.representer.Representer

      return value;
   }

   protected List<?> loadYamlData(final Reader io) throws IOException {
      final Yaml yaml = new Yaml(new Constructor(), new Representer(),
            new DumperOptions(), new YamlParserResolver());
      final Object loadedYaml = yaml.load(io);

      if (loadedYaml instanceof ArrayList) {
         return (ArrayList<?>) loadedYaml;
View Full Code Here

Examples of org.yaml.snakeyaml.representer.Representer

  @Nullable
  private static Map<String, Object> loadPubspecYamlInfo(final @NotNull String pubspecYamlFileContents) {
    // see com.google.dart.tools.core.utilities.yaml.PubYamlUtils#parsePubspecYamlToMap()
    // deprecated constructor used to be compatible with old snakeyaml version in testng.jar (it wins when running from sources or tests)
    //noinspection deprecation
    final Yaml yaml = new Yaml(new Loader(new Constructor()), new Dumper(new Representer(), new DumperOptions()), new Resolver() {
      @Override
      protected void addImplicitResolvers() {
        addImplicitResolver(Tag.NULL, NULL, "~nN\0");
        addImplicitResolver(Tag.NULL, EMPTY, null);
        addImplicitResolver(Tag.VALUE, VALUE, "=");
View Full Code Here

Examples of org.yaml.snakeyaml.representer.Representer

    DumperOptions options = new DumperOptions();

    options.setIndent(4);
    options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);

    yaml = new Yaml(new SafeConstructor(), new Representer(), options);

    this.file = file;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.