Package tech.ytsaurus.yson
Class YsonParser
- java.lang.Object
-
- tech.ytsaurus.yson.YsonParser
-
public class YsonParser extends java.lang.Object
Parser of YSON data.Class throws
YsonError
if yson is malformed. All IO errors are translated toUncheckedIOException
.
-
-
Constructor Summary
Constructors Constructor Description YsonParser(byte[] buffer)
YsonParser(byte[] buffer, int offset, int length)
YsonParser(java.io.InputStream input)
YsonParser(java.io.InputStream input, byte[] buffer)
YsonParser(java.io.InputStream input, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
parseAttributes(YsonConsumer consumer)
Parse only attributes and return its size in bytes.void
parseListFragment(YsonConsumer consumer)
Parse YSON list fragmentboolean
parseListFragmentItem(YsonConsumer consumer)
Parses single item of list fragment.void
parseNode(YsonConsumer consumer)
Parse YSON node.
-
-
-
Constructor Detail
-
YsonParser
public YsonParser(java.io.InputStream input)
-
YsonParser
public YsonParser(java.io.InputStream input, int bufferSize)
-
YsonParser
public YsonParser(java.io.InputStream input, byte[] buffer)
-
YsonParser
public YsonParser(byte[] buffer)
-
YsonParser
public YsonParser(byte[] buffer, int offset, int length)
-
-
Method Detail
-
parseNode
public void parseNode(YsonConsumer consumer)
Parse YSON node.This method will consume whole input stream and will throw
YsonError
exception if stream contains trailing (non whitespace) bytes.
-
parseAttributes
public int parseAttributes(YsonConsumer consumer)
Parse only attributes and return its size in bytes.
-
parseListFragment
public void parseListFragment(YsonConsumer consumer)
Parse YSON list fragmentThis method will consume whole input stream and will throw
YsonError
exception if stream contains trailing (non whitespace) bytes.
-
parseListFragmentItem
public boolean parseListFragmentItem(YsonConsumer consumer)
Parses single item of list fragment.Unlike
parseListFragment(tech.ytsaurus.yson.YsonConsumer)
that callsYsonConsumer.onListItem()
before each top level list item this method doesn't call- Returns:
- true if item is parsed or false if end of stream is reached.
-
-