Class ParserRegistry
java.lang.Object
org.infinispan.configuration.parsing.ParserRegistry
- All Implemented Interfaces:
NamespaceMappingParser
ParserRegistry is a namespace-mapping-aware meta-parser which provides a way to delegate the
parsing of multi-namespace XML files to appropriate parsers, defined by the
ConfigurationParser
interface. A registry of available parsers is built using the
ServiceLoader
system. Implementations of ConfigurationParser
should include a
META-INF/services/org.infinispan.configuration.parsing.ConfigurationParser file containing a list
of available parsers.- Since:
- 5.2
- Author:
- Tristan Tarrant
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Constructor Summary
ConstructorDescriptionParserRegistry
(ClassLoader classLoader) ParserRegistry
(ClassLoader classLoader, boolean defaultOnly, Properties properties) -
Method Summary
Modifier and TypeMethodDescriptionparse
(InputStream is, ConfigurationResourceResolver resourceResolver, MediaType mediaType) Parses the suppliedInputStream
returning a newConfigurationBuilderHolder
parse
(InputStream is, MediaType mediaType) Parses the suppliedInputStream
returning a newConfigurationBuilderHolder
.parse
(InputStream is, ConfigurationBuilderHolder holder, ConfigurationResourceResolver resourceResolver, MediaType mediaType) parse
(URL url, ConfigurationBuilderHolder holder) parse
(ConfigurationReader reader, ConfigurationBuilderHolder holder) void
parseAttribute
(ConfigurationReader reader, int i, ConfigurationBuilderHolder holder) Handle a namespaced attributevoid
parseElement
(ConfigurationReader reader, ConfigurationBuilderHolder holder) Recursively parses the current element of an XML stream using an appropriateConfigurationParser
depending on the element's namespace.void
serialize
(OutputStream os, String name, Configuration configuration) Deprecated, for removal: This API element is subject to removal in a future version.void
serialize
(OutputStream os, GlobalConfiguration globalConfiguration, Map<String, Configuration> configurations) Deprecated, for removal: This API element is subject to removal in a future version.serialize
(String name, Configuration configuration) Deprecated, for removal: This API element is subject to removal in a future version.void
serialize
(ConfigurationWriter writer, String name, Configuration configuration) Serializes a single cache configurationvoid
serialize
(ConfigurationWriter writer, GlobalConfiguration globalConfiguration, Map<String, Configuration> configurations) Serializes a full configuration to anConfigurationWriter
<T> void
serializeWith
(ConfigurationWriter writer, ConfigurationSerializer<T> serializer, T t) toString()
-
Constructor Details
-
ParserRegistry
public ParserRegistry() -
ParserRegistry
-
ParserRegistry
-
-
Method Details
-
parse
- Throws:
IOException
-
parse
- Throws:
IOException
-
parseFile
- Throws:
IOException
-
parseFile
- Throws:
IOException
-
parse
-
parse
-
parse
Parses the suppliedInputStream
returning a newConfigurationBuilderHolder
. This method uses a defaultConfigurationResourceResolver
.- Parameters:
is
- anInputStream
pointing to a configuration file- Returns:
- a new
ConfigurationBuilderHolder
which contains the parsed configuration
-
parse
public ConfigurationBuilderHolder parse(InputStream is, ConfigurationResourceResolver resourceResolver, MediaType mediaType) Parses the suppliedInputStream
returning a newConfigurationBuilderHolder
- Parameters:
is
- anInputStream
pointing to a configuration fileresourceResolver
- aConfigurationResourceResolver
resolver for Xinclude- Returns:
- a new
ConfigurationBuilderHolder
which contains the parsed configuration
-
parse
public ConfigurationBuilderHolder parse(URL url, ConfigurationBuilderHolder holder) throws IOException - Throws:
IOException
-
parse
public ConfigurationBuilderHolder parse(InputStream is, ConfigurationBuilderHolder holder, ConfigurationResourceResolver resourceResolver, MediaType mediaType) -
parse
public ConfigurationBuilderHolder parse(ConfigurationReader reader, ConfigurationBuilderHolder holder) -
parseElement
Description copied from interface:NamespaceMappingParser
Recursively parses the current element of an XML stream using an appropriateConfigurationParser
depending on the element's namespace.- Specified by:
parseElement
in interfaceNamespaceMappingParser
- Parameters:
reader
- the configuration stream readerholder
- a configuration holder
-
parseAttribute
public void parseAttribute(ConfigurationReader reader, int i, ConfigurationBuilderHolder holder) throws ConfigurationReaderException Description copied from interface:NamespaceMappingParser
Handle a namespaced attribute- Specified by:
parseAttribute
in interfaceNamespaceMappingParser
- Parameters:
reader
- the configuration stream readeri
- the index of the attributeholder
- a configuration holder- Throws:
ConfigurationReaderException
-
serialize
@Deprecated(forRemoval=true) public void serialize(OutputStream os, GlobalConfiguration globalConfiguration, Map<String, Configuration> configurations) Deprecated, for removal: This API element is subject to removal in a future version.Serializes a full configuration to anOutputStream
- Parameters:
os
- the output stream where the configuration should be serialized toglobalConfiguration
- the global configuration. Can be nullconfigurations
- a map of named configurations
-
serialize
public void serialize(ConfigurationWriter writer, GlobalConfiguration globalConfiguration, Map<String, Configuration> configurations) Serializes a full configuration to anConfigurationWriter
- Parameters:
writer
- the writer where the configuration should be serialized toglobalConfiguration
- the global configuration. Can be nullconfigurations
- a map of named configurations
-
serializeWith
public <T> void serializeWith(ConfigurationWriter writer, ConfigurationSerializer<T> serializer, T t) -
serialize
@Deprecated(forRemoval=true) public void serialize(OutputStream os, String name, Configuration configuration) Deprecated, for removal: This API element is subject to removal in a future version.Serializes a single configuration to an OutputStream- Parameters:
os
-name
-configuration
-
-
serialize
Deprecated, for removal: This API element is subject to removal in a future version.Serializes a single configuration to a String- Parameters:
name
- the name of the configurationconfiguration
- theConfiguration
- Returns:
- the XML representation of the specified configuration
-
toString
-
serialize
Serializes a single cache configuration- Parameters:
writer
-name
-configuration
-
-
serialize(ConfigurationWriter, GlobalConfiguration, Map)
instead