public class Parser extends Object
parse
to transform serialized RDF forms into Graph
s.
Functionality is delegated to registered ParsingProvider
s. Such
ParsingProvider
s can be registered and unregistered, later
registered
ParsingProvider
s shadow previously registered providers for the
same format.
Note on synchronization:
ParsingProvider
s must be able to handle concurrent requests.Constructor and Description |
---|
Parser()
the constructor sets the singleton instance to allow instantiation
by OSGi-DS.
|
Modifier and Type | Method and Description |
---|---|
protected void |
activate(org.osgi.service.component.ComponentContext componentContext) |
protected void |
bindConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin) |
void |
bindParsingProvider(ParsingProvider provider)
Registers a parsing provider
|
protected void |
deactivate(org.osgi.service.component.ComponentContext componentContext) |
static Parser |
getInstance()
This returns the singleton instance, if an instance has been previously
created (e.g.
|
Set<String> |
getSupportedFormats()
Get a set of supported formats
|
Graph |
parse(InputStream serializedGraph,
String formatIdentifier)
Parses a serialized Graph from an InputStream.
|
Graph |
parse(InputStream serializedGraph,
String formatIdentifier,
UriRef baseUri)
Parses a serialized Graph from an InputStream.
|
void |
parse(MGraph target,
InputStream serializedGraph,
String formatIdentifier)
Parses a serialized Graph from an InputStream.
|
void |
parse(MGraph target,
InputStream serializedGraph,
String formatIdentifier,
UriRef baseUri)
Parses a serialized Graph from an InputStream.
|
protected void |
unbindConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin) |
void |
unbindParsingProvider(ParsingProvider provider)
Unregister a parsing provider
|
public Parser()
getInstance
method should be used.public static Parser getInstance()
protected void activate(org.osgi.service.component.ComponentContext componentContext)
protected void deactivate(org.osgi.service.component.ComponentContext componentContext)
public Graph parse(InputStream serializedGraph, String formatIdentifier) throws UnsupportedFormatException
serializedGraph
- an inputstream with the serializationformatIdentifier
- a string identifying the format (usually the MIME-type)UnsupportedFormatException
public void parse(MGraph target, InputStream serializedGraph, String formatIdentifier) throws UnsupportedFormatException
target
- the MGraph to which the parsed triples are addedserializedGraph
- an inputstream with the serializationformatIdentifier
- a string identifying the format (usually the MIME-type)UnsupportedFormatException
public Graph parse(InputStream serializedGraph, String formatIdentifier, UriRef baseUri) throws UnsupportedFormatException
serializedGraph
- an inputstream with the serializationformatIdentifier
- a string identifying the format (usually the MIME-type)baseUri
- the uri against which relative uri-refs are evaluatedUnsupportedFormatException
public void parse(MGraph target, InputStream serializedGraph, String formatIdentifier, UriRef baseUri) throws UnsupportedFormatException
target
- the MGraph to which the parsed triples are addedserializedGraph
- an inputstream with the serializationformatIdentifier
- a string identifying the format (usually the MIME-type)baseUri
- the uri against which relative uri-refs are evaluatedUnsupportedFormatException
public Set<String> getSupportedFormats()
public void bindParsingProvider(ParsingProvider provider)
provider
- the provider to be registeredpublic void unbindParsingProvider(ParsingProvider provider)
provider
- the provider to be deregisteredprotected void bindConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
protected void unbindConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.