@Deprecated public class Serializer extends Object
From 2.12.1 onwards this is replaced instead with the
SerializerRegistry
which provides a central place to obtain a
serializer for a query/update and allows the serialization process to be
customised rather than being hard coded.
For example an existing call like
Serializer.serialize(q, writer, Syntax.syntaxSPARQL_11)
would be
replaced with the following:
QuerySerializerFactory factory = SerializerRegistry.get().getQuerySerializer(Syntax.syntaxSPARQL_11); if (factory == null) throw new ARQException("No serializer registered for syntax"); QueryVisitor serializer = factory.create(Syntax.syntaxSPARQL_11, q, writer); q.visit(serializer);
While this is more verbose it has the advantage of being much more flexible as previously there was no way to customise serialization such that it would be used throughout ARQ automatically.
Constructor and Description |
---|
Serializer()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static void |
serialize(Query query,
IndentedLineBuffer buff)
Deprecated.
Format the query into the buffer
|
static void |
serialize(Query query,
IndentedLineBuffer buff,
Syntax outSyntax)
Deprecated.
Format the query
|
static void |
serialize(Query query,
IndentedWriter writer)
Deprecated.
Format the query
|
static void |
serialize(Query query,
IndentedWriter writer,
Syntax outSyntax)
Deprecated.
Format the query
|
static void |
serialize(Query query,
OutputStream out)
Deprecated.
Output the query
|
static void |
serialize(Query query,
OutputStream out,
Syntax syntax)
Deprecated.
Output the query
|
static void |
serializeARQ(Query query,
IndentedWriter writer)
Deprecated.
|
static void |
serializeARQ(Query query,
Prologue p,
IndentedWriter writer)
Deprecated.
|
static void |
serializeSPARQL_10(Query query,
IndentedWriter writer)
Deprecated.
|
static void |
serializeSPARQL_11(Query query,
IndentedWriter writer)
Deprecated.
|
public static void serialize(Query query, OutputStream out)
query
- The queryout
- OutputStreampublic static void serialize(Query query, OutputStream out, Syntax syntax)
query
- The queryout
- OutputStreamsyntax
- Syntax URIpublic static void serialize(Query query, IndentedLineBuffer buff)
query
- The querybuff
- IndentedLineBufferpublic static void serialize(Query query, IndentedLineBuffer buff, Syntax outSyntax)
query
- The querybuff
- IndentedLineBuffer in which to place the unparsed queryoutSyntax
- Syntax URIpublic static void serialize(Query query, IndentedWriter writer)
query
- The querywriter
- IndentedWriterpublic static void serialize(Query query, IndentedWriter writer, Syntax outSyntax)
writer
- IndentedWriteroutSyntax
- Syntax URIpublic static void serializeARQ(Query query, IndentedWriter writer)
public static void serializeARQ(Query query, Prologue p, IndentedWriter writer)
public static void serializeSPARQL_10(Query query, IndentedWriter writer)
public static void serializeSPARQL_11(Query query, IndentedWriter writer)
Licenced under the Apache License, Version 2.0