public class SerializerRegistry extends Object
By registering custom QuerySerializerFactory
or
UpdateSerializerFactory
instances the mapping of a syntax to a
serialization can be customised and this allows the serialization of queries
and updates to be customised if desired.
This feature is primarily intended for system programmers as changing how queries and updates are serialized could have knock on effects particularly if you use ARQ to interact with remote systems. The default registered serializers produce standards compliant SPARQL syntax and should be more than sufficient in most cases
Modifier and Type | Method and Description |
---|---|
void |
addQuerySerializer(Syntax syntax,
QuerySerializerFactory factory)
Adds a query serializer factory for the given syntax
|
void |
addUpdateSerializer(Syntax syntax,
UpdateSerializerFactory factory)
Adds an update serializer factory for the given syntax
|
boolean |
containsQuerySerializer(Syntax syntax)
Gets whether a query serializer factory is registered for the given
syntax
|
boolean |
containsUpdateSerializer(Syntax syntax)
Gets whether an update serializer factory is registered for the given
syntax
|
static SerializerRegistry |
get()
Gets the serializer registry which is a singleton lazily instantiating it
if this is the first time this method has been called
|
QuerySerializerFactory |
getQuerySerializerFactory(Syntax syntax)
Gets the query serializer factory for the given syntax which may be null
if there is none registered
|
UpdateSerializerFactory |
getUpdateSerializerFactory(Syntax syntax)
Gets the update serializer factory for the given syntax which may be null
if there is none registered
|
void |
removeQuerySerializer(Syntax syntax)
Removes the query serializer factory for the given syntax
|
void |
removeUpdateSerializer(Syntax syntax)
Removes the update serializer factory for the given syntax
|
public static SerializerRegistry get()
public void addQuerySerializer(Syntax syntax, QuerySerializerFactory factory)
syntax
- Syntaxfactory
- Serializer factoryIllegalArgumentException
- Thrown if the given factory does not accept the given syntaxpublic void addUpdateSerializer(Syntax syntax, UpdateSerializerFactory factory)
syntax
- Syntaxfactory
- Serializer factoryIllegalArgumentException
- Thrown if the given factory does not accept the given syntaxpublic boolean containsQuerySerializer(Syntax syntax)
syntax
- Syntaxpublic boolean containsUpdateSerializer(Syntax syntax)
syntax
- Syntaxpublic QuerySerializerFactory getQuerySerializerFactory(Syntax syntax)
syntax
- Syntaxpublic UpdateSerializerFactory getUpdateSerializerFactory(Syntax syntax)
syntax
- Syntaxpublic void removeQuerySerializer(Syntax syntax)
syntax
- Syntaxpublic void removeUpdateSerializer(Syntax syntax)
syntax
- SyntaxLicenced under the Apache License, Version 2.0