Class RdfProtoParser

All Implemented Interfaces:
RdfMetaProvider, XmlMetaProvider

public class RdfProtoParser extends RdfStreamParser
Stream-based RDF parser for RDF/PROTO binary format.

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

Examples:

// Parse RDF/PROTO bytes into a bean. byte[] protoBytes = RdfProto.of(person); Person person = RdfProtoParser.DEFAULT.read(protoBytes, Person.class);

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

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

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

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

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

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