Class NQuads
NQuadsSerializer and NQuadsParser into a single class with convenience to/of methods.
Examples:
Example output (bean with name/age, N-Triples with graph):
<...> <.../name> "Alice" <...> . <...> <.../age> "30"^^<http://www.w3.org/2001/XMLSchema#int> <...> .
Complex (nested address + array):
<...> <.../name> "Alice" <graph> . <...> <.../address> <.../address> <graph> . <.../address> <.../street> "123 Main St" <graph> . <.../address> <.../city> "Boston" <graph> . <.../address> <.../state> "MA" <graph> .
See Also:
- {doc jmr.RdfDetails}
- {doc jm.Marshallers}
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNQuads()Constructor using defaults.Constructor with serializer and parser. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringSerializes a POJO to aString using theDEFAULTmarshaller.static <T> TParses an input into the specified object type using theDEFAULTmarshaller.static <T> TParses an input into the specified parameterized object type using theDEFAULTmarshaller.Methods inherited from class org.apache.juneau.marshall.marshaller.CharMarshaller
read, read, writeMethods inherited from class org.apache.juneau.marshall.marshaller.Marshaller
getParser, getSerializer, read, read, readArrayRecords, readRecords, readTokens, write, writeArrayRecords, writeRecords, writeTokens
-
Field Details
-
DEFAULT
Default reusable instance.
-
-
Constructor Details
-
NQuads
public NQuads()Constructor using defaults. -
NQuads
Constructor with serializer and parser.- Parameters:
s- The serializer to use.
Must not benull .p- The parser to use.
Must not benull .
-
-
Method Details
-
of
Serializes a POJO to aString using theDEFAULTmarshaller.A shortcut for calling
.DEFAULT .write(object )- Parameters:
object- The object to serialize.- Returns:
- The serialized object.
- Throws:
SerializeException- If a problem occurred trying to convert the output.
-
to
Parses an input into the specified object type using theDEFAULTmarshaller.A shortcut for calling
.DEFAULT .read(input ,type )- Type Parameters:
T- The class type of the object being created.- Parameters:
input- The input.type- The object type to create.- Returns:
- The parsed object.
- Throws:
ParseException- Malformed input encountered.
-
to
Parses an input into the specified parameterized object type using theDEFAULTmarshaller.A shortcut for calling
.DEFAULT .read(input ,type ,args )- Type Parameters:
T- The class type of the object to create.- Parameters:
input- The input.type- The object type to create.args- The type arguments of the class if it's a collection or map.- Returns:
- The parsed object.
- Throws:
ParseException- Malformed input encountered.
-