/** * Produce the corresponding representation tree for a given Object. * * @see <a href="http://yaml.org/spec/1.1/#id859333">Figure 3.1. Processing * Overview</a> * @param data * instance to build the representation tree for * @return representation tree */ public Node represent(Object data) { return representer.represent(data); }
private void dumpAll(Iterator<? extends Object> data, Writer output, Tag rootTag) { Serializer serializer = new Serializer(new Emitter(output, dumperOptions), resolver, dumperOptions, rootTag); try { serializer.open(); while (data.hasNext()) { Node node = representer.represent(data.next()); serializer.serialize(node); } serializer.close(); } catch (IOException e) { throw new YAMLException(e); } }
/** * Produce the corresponding representation tree for a given Object. * * @see <a href="http://yaml.org/spec/1.1/#id859333">Figure 3.1. Processing * Overview</a> * @param data * instance to build the representation tree for * @return representation tree */ public Node represent(Object data) { return representer.represent(data); }
/** * Produce the corresponding representation tree for a given Object. * * @see <a href="http://yaml.org/spec/1.1/#id859333">Figure 3.1. Processing * Overview</a> * @param data * instance to build the representation tree for * @return representation tree */ public Node represent(Object data) { return representer.represent(data); }
/** * Produce the corresponding representation tree for a given Object. * * @see <a href="http://yaml.org/spec/1.1/#id859333">Figure 3.1. Processing * Overview</a> * @param data * instance to build the representation tree for * @return representation tree */ public Node represent(Object data) { return representer.represent(data); }
public void write(Writer output, Map<String, Object> o, Model model) throws IOException { //TODO improve SnakeYAML API (A. Somov) DumperOptions dumperOptions = new DumperOptions(); dumperOptions.setIndent(2); dumperOptions.setWidth(80); Serializer serializer = new Serializer(new Emitter(output, dumperOptions), new ModelResolver(), dumperOptions, Tag.MAP); Representer representer = new ModelRepresenter(); try { serializer.open(); Node node = representer.represent(model); serializer.serialize(node); serializer.close(); } catch (IOException e) { throw new YAMLException(e); } } }
private void dumpAll(Iterator<? extends Object> data, Writer output, Tag rootTag) { Serializer serializer = new Serializer(new Emitter(output, dumperOptions), resolver, dumperOptions, rootTag); try { serializer.open(); while (data.hasNext()) { Node node = representer.represent(data.next()); serializer.serialize(node); } serializer.close(); } catch (IOException e) { throw new YAMLException(e); } }
private void dumpAll(Iterator<? extends Object> data, Writer output, Tag rootTag) { Serializer serializer = new Serializer(new Emitter(output, dumperOptions), resolver, dumperOptions, rootTag); try { serializer.open(); while (data.hasNext()) { Node node = representer.represent(data.next()); serializer.serialize(node); } serializer.close(); } catch (IOException e) { throw new YAMLException(e); } }
private void dumpAll(Iterator<? extends Object> data, Writer output, Tag rootTag) { Serializer serializer = new Serializer(new Emitter(output, dumperOptions), resolver, dumperOptions, rootTag); try { serializer.open(); while (data.hasNext()) { Node node = representer.represent(data.next()); serializer.serialize(node); } serializer.close(); } catch (IOException e) { throw new YAMLException(e); } }
public void write(Writer output, Map<String, Object> o, Model model) throws IOException { //TODO improve SnakeYAML API (A. Somov) DumperOptions dumperOptions = new DumperOptions(); dumperOptions.setIndent(2); dumperOptions.setWidth(80); Serializer serializer = new Serializer(new Emitter(output, dumperOptions), new ModelResolver(), dumperOptions, Tag.MAP); Representer representer = new ModelRepresenter(); try { serializer.open(); Node node = representer.represent(model); serializer.serialize(node); serializer.close(); } catch (IOException e) { throw new YAMLException(e); } } }
Node node = representer.represent(doc); YAMLEmitter emitter = new YAMLEmitter(yamlFileDescriptor, scanner); Serializer serializer = new Serializer(emitter, new Resolver(), options, null);