public class PropertiesXmlFormat extends Object implements ConfigurationFormat
ConfigurationFormat
for xml property
files.Constructor and Description |
---|
PropertiesXmlFormat() |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(URL url)
Allows the format to examine the given resource, e.g. for a matching file ending.
|
String |
getName()
Get a unique name of the format.
|
ConfigurationData |
readConfiguration(String resource,
InputStream inputStream)
Reads a configuration from an URL, hereby parsing the given
InputStream . |
public String getName()
ConfigurationFormat
getName
in interface ConfigurationFormat
public boolean accepts(URL url)
ConfigurationFormat
accepts
in interface ConfigurationFormat
url
- the url to read the configuration data from (could be a file, a server location, a classpath
resource or something else, not null.public ConfigurationData readConfiguration(String resource, InputStream inputStream)
ConfigurationFormat
InputStream
. Dependening on
the capabilities of the format the returned ConfigurationData
may contain
different levels of data:
ConfigurationData.getCombinedProperties()
. This allows to use the properties as inout to a default mapping,
which is always appropriate as long as no other semnatics
are defined in the concrete target scenario.PropertySource
instances with different ordinal levels. As an example imagine a custom format that contains sections
'defaults', 'global-defaults', 'application', 'server-overrides'.PropertySource
.readConfiguration
in interface ConfigurationFormat
resource
- a descriptive name for the resource, since an InputStream does not have any)inputStream
- the inputStream to read the configuration data from (could be a file, a server location, a classpath
resource or something else.ConfigurationData
containing sections/properties read, never null
.PropertySource
Copyright © 2014–2016 Apache Software Foundation. All rights reserved.