public class Consumer { public static void main(String[] args) { Parser p = new ParserImpl(); // just like a Java class! ... } }
private Event parseFlowNode() { return parseNode(false, false); }
/** * Get the next event and proceed further. */ public Event getEvent() { peekEvent(); Event value = currentEvent; currentEvent = null; return value; }
Event evt; try { evt = _yamlParser.getEvent(); } catch (org.yaml.snakeyaml.error.YAMLException e) { if (e instanceof org.yaml.snakeyaml.error.MarkedYAMLException) {
Event evt; try { evt = _yamlParser.getEvent(); } catch (org.yaml.snakeyaml.error.YAMLException e) { if (e instanceof org.yaml.snakeyaml.error.MarkedYAMLException) {
private Object loadFromReader(StreamReader sreader, Class<?> type) { Composer composer = new Composer(new ParserImpl(sreader), resolver); constructor.setComposer(composer); return constructor.getSingleData(type); }
/** * Check the type of the next event. */ public boolean checkEvent(Event.ID choice) { peekEvent(); return currentEvent != null && currentEvent.is(choice); }
private Event parseBlockNodeOrIndentlessSequence() { return parseNode(true, true); }
Event evt; try { evt = _yamlParser.getEvent(); } catch (org.yaml.snakeyaml.error.YAMLException e) { if (e instanceof org.yaml.snakeyaml.error.MarkedYAMLException) {
public YAMLParser(IOContext ctxt, BufferRecycler br, int parserFeatures, int formatFeatures, ObjectCodec codec, Reader reader) { super(ctxt, parserFeatures); _objectCodec = codec; _formatFeatures = formatFeatures; _reader = reader; _yamlParser = new ParserImpl(new StreamReader(reader)); }
/** * Get the next event and proceed further. */ public Event getEvent() { peekEvent(); Event value = currentEvent; currentEvent = null; return value; }
private Event parseFlowNode() { return parseNode(false, false); }
Event evt; try { evt = _yamlParser.getEvent(); } catch (org.yaml.snakeyaml.error.YAMLException e) { if (e instanceof org.yaml.snakeyaml.error.MarkedYAMLException) {
/** * 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); return composer.getSingleNode(); }
/** * Get the next event and proceed further. */ public Event getEvent() { peekEvent(); Event value = currentEvent; currentEvent = null; return value; }
private Event parseFlowNode() { return parseNode(false, false); }
public YAMLParser(IOContext ctxt, BufferRecycler br, int parserFeatures, int formatFeatures, ObjectCodec codec, Reader reader) { super(ctxt, parserFeatures); _objectCodec = codec; _formatFeatures = formatFeatures; _reader = reader; _yamlParser = new ParserImpl(new StreamReader(reader)); }
/** * Get the next event and proceed further. */ public Event getEvent() { peekEvent(); Event value = currentEvent; currentEvent = null; return value; }
private Event parseFlowNode() { return parseNode(false, false); }
/** * 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); 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); }