java.lang.Object
org.apache.jena.sparql.serializer.SerializerRegistry
Provides a registry of serializers for queries and updates
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addQuerySerializer
(Syntax syntax, QuerySerializerFactory factory) Adds a query serializer factory for the given syntaxvoid
addUpdateSerializer
(Syntax syntax, UpdateSerializerFactory factory) Adds an update serializer factory for the given syntaxboolean
containsQuerySerializer
(Syntax syntax) Gets whether a query serializer factory is registered for the given syntaxboolean
containsUpdateSerializer
(Syntax syntax) Gets whether an update serializer factory is registered for the given syntaxstatic SerializerRegistry
get()
Gets the serializer registry which is a singleton lazily instantiating it if this is the first time this method has been calledgetQuerySerializerFactory
(Syntax syntax) Gets the query serializer factory for the given syntax which may be null if there is none registeredgetUpdateSerializerFactory
(Syntax syntax) Gets the update serializer factory for the given syntax which may be null if there is none registeredvoid
removeQuerySerializer
(Syntax syntax) Removes the query serializer factory for the given syntaxvoid
removeUpdateSerializer
(Syntax syntax) Removes the update serializer factory for the given syntax
-
Method Details
-
get
Gets the serializer registry which is a singleton lazily instantiating it if this is the first time this method has been called- Returns:
- Registry
-
addQuerySerializer
Adds a query serializer factory for the given syntax- Parameters:
syntax
- Syntaxfactory
- Serializer factory- Throws:
IllegalArgumentException
- Thrown if the given factory does not accept the given syntax
-
addUpdateSerializer
Adds an update serializer factory for the given syntax- Parameters:
syntax
- Syntaxfactory
- Serializer factory- Throws:
IllegalArgumentException
- Thrown if the given factory does not accept the given syntax
-
containsQuerySerializer
Gets whether a query serializer factory is registered for the given syntax- Parameters:
syntax
- Syntax- Returns:
- True if registered, false otherwise
-
containsUpdateSerializer
Gets whether an update serializer factory is registered for the given syntax- Parameters:
syntax
- Syntax- Returns:
- True if registered, false otherwise
-
getQuerySerializerFactory
Gets the query serializer factory for the given syntax which may be null if there is none registered- Parameters:
syntax
- Syntax- Returns:
- Query Serializer Factory or null if none registered for the given syntax
-
getUpdateSerializerFactory
Gets the update serializer factory for the given syntax which may be null if there is none registered- Parameters:
syntax
- Syntax- Returns:
- Update Serializer Factory or null if none registered for the given syntax
-
removeQuerySerializer
Removes the query serializer factory for the given syntax- Parameters:
syntax
- Syntax
-
removeUpdateSerializer
Removes the update serializer factory for the given syntax- Parameters:
syntax
- Syntax
-