Class RdfThriftParser

All Implemented Interfaces:
RdfMetaProvider, XmlMetaProvider

public class RdfThriftParser extends RdfStreamParser
Stream-based RDF parser for RDF/THRIFT binary format.

Parses compact binary RDF (Apache Thrift encoding) into POJOs. Accepts byte arrays and input streams. Semantically equivalent to RDF/XML parsing—produces the same Java objects.

Examples:

// Parse RDF/THRIFT bytes into a bean. byte[] thriftBytes = RdfThrift.of(person); Person person = RdfThriftParser.DEFAULT.read(thriftBytes, Person.class);

// Or use the RdfThrift marshaller for convenience. Person person = RdfThrift.to(thriftBytes, Person.class);

// Parse into a map with key/value types. Map<String, String> map = RdfThriftParser.DEFAULT.read(thriftBytes, Map.class, String.class, String.class);

// Parse from InputStream. Person person = RdfThriftParser.DEFAULT.read(inputStream, Person.class);

// Custom parser with swaps. RdfThriftParser p = RdfThriftParser.create().swaps(DateSwap.class).build(); MyBean bean = p.read(thriftBytes, MyBean.class);

Input is binary (byte[] or InputStream). Complex structures (nested objects, arrays) are supported—they are encoded as equivalent RDF triples in Apache Thrift format.

Notes:
  • This class is thread safe and reusable.
See Also: