private Object loadFromReader(StreamReader sreader, Class<?> type) { Composer composer = new Composer(new ParserImpl(sreader), resolver); constructor.setComposer(composer); return constructor.getSingleData(type); }
/** * Parse all YAML documents in the Reader and produce corresponding Java * objects. The documents are parsed only when the iterator is invoked. * * @param yaml * YAML data to load from (BOM must not be present) * @return an Iterable over the parsed Java objects in this String in proper * sequence */ public Iterable<Object> loadAll(Reader yaml) { Composer composer = new Composer(new ParserImpl(new StreamReader(yaml)), resolver); constructor.setComposer(composer); Iterator<Object> result = new Iterator<Object>() { @Override public boolean hasNext() { return constructor.checkData(); } @Override public Object next() { return constructor.getData(); } @Override public void remove() { throw new UnsupportedOperationException(); } }; return new YamlIterable(result); }
private Object loadFromReader(StreamReader sreader, Class<?> type) { Composer composer = new Composer(new ParserImpl(sreader), resolver); constructor.setComposer(composer); return constructor.getSingleData(type); }
private Object loadFromReader(StreamReader sreader, Class<?> type) { Composer composer = new Composer(new ParserImpl(sreader), resolver); constructor.setComposer(composer); return constructor.getSingleData(type); }
private Object loadFromReader(StreamReader sreader, Class<?> type) { Composer composer = new Composer(new ParserImpl(sreader), resolver); constructor.setComposer(composer); return constructor.getSingleData(type); }
/** * Parse the first YAML document in a stream and produce the corresponding * representation tree. (This is the opposite of the represent() method) * * @see <a href="http://yaml.org/spec/1.1/#id859333">Figure 3.1. Processing * Overview</a> * @param yaml * YAML document * @return parsed root Node for the specified YAML document */ public Node compose(Reader yaml) { Composer composer = new Composer(new ParserImpl(new StreamReader(yaml)), resolver); constructor.setComposer(composer); return composer.getSingleNode(); }
/** * Parse the first YAML document in a stream and produce the corresponding * representation tree. (This is the opposite of the represent() method) * * @see <a href="http://yaml.org/spec/1.1/#id859333">Figure 3.1. Processing * Overview</a> * @param yaml * YAML document * @return parsed root Node for the specified YAML document */ public Node compose(Reader yaml) { Composer composer = new Composer(new ParserImpl(new StreamReader(yaml)), resolver); constructor.setComposer(composer); return composer.getSingleNode(); }
/** * Parse the first YAML document in a stream and produce the corresponding * representation tree. (This is the opposite of the represent() method) * * @see <a href="http://yaml.org/spec/1.1/#id859333">Figure 3.1. Processing * Overview</a> * @param yaml * YAML document * @return parsed root Node for the specified YAML document */ public Node compose(Reader yaml) { Composer composer = new Composer(new ParserImpl(new StreamReader(yaml)), resolver); constructor.setComposer(composer); return composer.getSingleNode(); }
/** * Parse all YAML documents in a String and produce corresponding Java * objects. The documents are parsed only when the iterator is invoked. * * @param yaml * YAML data to load from (BOM must not be present) * @return an iterator over the parsed Java objects in this String in proper * sequence */ public Iterable<Object> loadAll(Reader yaml) { Composer composer = new Composer(new ParserImpl(new StreamReader(yaml)), resolver); constructor.setComposer(composer); Iterator<Object> result = new Iterator<Object>() { public boolean hasNext() { return constructor.checkData(); } public Object next() { return constructor.getData(); } public void remove() { throw new UnsupportedOperationException(); } }; return new YamlIterable(result); }
/** * Parse all YAML documents in a stream and produce corresponding * representation trees. * * @see <a href="http://yaml.org/spec/1.1/#id859333">Processing Overview</a> * @param yaml * stream of YAML documents * @return parsed root Nodes for all the specified YAML documents */ public Iterable<Node> composeAll(Reader yaml) { final Composer composer = new Composer(new ParserImpl(new StreamReader(yaml)), resolver); constructor.setComposer(composer); Iterator<Node> result = new Iterator<Node>() { public boolean hasNext() { return composer.checkNode(); } public Node next() { return composer.getNode(); } public void remove() { throw new UnsupportedOperationException(); } }; return new NodeIterable(result); }
/** * Parse all YAML documents in a String and produce corresponding Java * objects. The documents are parsed only when the iterator is invoked. * * @param yaml * YAML data to load from (BOM must not be present) * @return an iterator over the parsed Java objects in this String in proper * sequence */ public Iterable<Object> loadAll(Reader yaml) { Composer composer = new Composer(new ParserImpl(new StreamReader(yaml)), resolver); constructor.setComposer(composer); Iterator<Object> result = new Iterator<Object>() { public boolean hasNext() { return constructor.checkData(); } public Object next() { return constructor.getData(); } public void remove() { throw new UnsupportedOperationException(); } }; return new YamlIterable(result); }
/** * Parse all YAML documents in a stream and produce corresponding * representation trees. * * @see <a href="http://yaml.org/spec/1.1/#id859333">Processing Overview</a> * @param yaml * stream of YAML documents * @return parsed root Nodes for all the specified YAML documents */ public Iterable<Node> composeAll(Reader yaml) { final Composer composer = new Composer(new ParserImpl(new StreamReader(yaml)), resolver); constructor.setComposer(composer); Iterator<Node> result = new Iterator<Node>() { public boolean hasNext() { return composer.checkNode(); } public Node next() { return composer.getNode(); } public void remove() { throw new UnsupportedOperationException(); } }; return new NodeIterable(result); }
/** * Parse all YAML documents in a String and produce corresponding Java * objects. The documents are parsed only when the iterator is invoked. * * @param yaml * YAML data to load from (BOM must not be present) * @return an iterator over the parsed Java objects in this String in proper * sequence */ public Iterable<Object> loadAll(Reader yaml) { Composer composer = new Composer(new ParserImpl(new StreamReader(yaml)), resolver); constructor.setComposer(composer); Iterator<Object> result = new Iterator<Object>() { @Override public boolean hasNext() { return constructor.checkData(); } @Override public Object next() { return constructor.getData(); } @Override public void remove() { throw new UnsupportedOperationException(); } }; return new YamlIterable(result); }
/** * Parse all YAML documents in a stream and produce corresponding * representation trees. * * @see <a href="http://yaml.org/spec/1.1/#id859333">Processing Overview</a> * @param yaml * stream of YAML documents * @return parsed root Nodes for all the specified YAML documents */ public Iterable<Node> composeAll(Reader yaml) { final Composer composer = new Composer(new ParserImpl(new StreamReader(yaml)), resolver); constructor.setComposer(composer); Iterator<Node> result = new Iterator<Node>() { @Override public boolean hasNext() { return composer.checkNode(); } @Override public Node next() { return composer.getNode(); } @Override public void remove() { throw new UnsupportedOperationException(); } }; return new NodeIterable(result); }