Class SerializerRegistry
- java.lang.Object
-
- org.apache.jena.sparql.serializer.SerializerRegistry
-
public class SerializerRegistry extends java.lang.Object
Provides a registry of serializers for queries and updatesBy registering custom
QuerySerializerFactory
orUpdateSerializerFactory
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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 calledQuerySerializerFactory
getQuerySerializerFactory(Syntax syntax)
Gets the query serializer factory for the given syntax which may be null if there is none registeredUpdateSerializerFactory
getUpdateSerializerFactory(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 Detail
-
get
public 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- Returns:
- Registry
-
addQuerySerializer
public void addQuerySerializer(Syntax syntax, QuerySerializerFactory factory)
Adds a query serializer factory for the given syntax- Parameters:
syntax
- Syntaxfactory
- Serializer factory- Throws:
java.lang.IllegalArgumentException
- Thrown if the given factory does not accept the given syntax
-
addUpdateSerializer
public void addUpdateSerializer(Syntax syntax, UpdateSerializerFactory factory)
Adds an update serializer factory for the given syntax- Parameters:
syntax
- Syntaxfactory
- Serializer factory- Throws:
java.lang.IllegalArgumentException
- Thrown if the given factory does not accept the given syntax
-
containsQuerySerializer
public boolean containsQuerySerializer(Syntax syntax)
Gets whether a query serializer factory is registered for the given syntax- Parameters:
syntax
- Syntax- Returns:
- True if registered, false otherwise
-
containsUpdateSerializer
public boolean containsUpdateSerializer(Syntax syntax)
Gets whether an update serializer factory is registered for the given syntax- Parameters:
syntax
- Syntax- Returns:
- True if registered, false otherwise
-
getQuerySerializerFactory
public QuerySerializerFactory getQuerySerializerFactory(Syntax syntax)
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
public UpdateSerializerFactory getUpdateSerializerFactory(Syntax syntax)
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
public void removeQuerySerializer(Syntax syntax)
Removes the query serializer factory for the given syntax- Parameters:
syntax
- Syntax
-
removeUpdateSerializer
public void removeUpdateSerializer(Syntax syntax)
Removes the update serializer factory for the given syntax- Parameters:
syntax
- Syntax
-
-