- All Superinterfaces:
org.refcodes.mixin.FilenameSuffixesAccessor
- All Known Subinterfaces:
ResourcePropertiesFactory.ResourcePropertiesBuilderFactory
- All Known Implementing Classes:
JavaProperties.JavaPropertiesFactory
,JavaPropertiesBuilder.JavaPropertiesBuilderFactory
,JsonProperties.JsonPropertiesFactory
,JsonPropertiesBuilder.JsonPropertiesBuilderFactory
,PolyglotProperties.PolyglotPropertiesFactory
,PolyglotPropertiesBuilder.PolyglotPropertiesBuilderFactory
,TomlProperties.TomlPropertiesFactory
,TomlPropertiesBuilder.TomlPropertiesBuilderFactory
,XmlProperties.XmlPropertiesFactory
,XmlPropertiesBuilder.XmlPropertiesBuilderFactory
,YamlProperties.YamlPropertiesFactory
,YamlPropertiesBuilder.YamlPropertiesBuilderFactory
public interface ResourcePropertiesFactory
extends org.refcodes.mixin.FilenameSuffixesAccessor
Factory interface for creating
ResourceProperties
instances.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Factory interface for creatingResourceProperties.ResourcePropertiesBuilder
instances.Nested classes/interfaces inherited from interface org.refcodes.mixin.FilenameSuffixesAccessor
org.refcodes.mixin.FilenameSuffixesAccessor.FilenameSuffixesBuilder<B extends org.refcodes.mixin.FilenameSuffixesAccessor.FilenameSuffixesBuilder<B>>, org.refcodes.mixin.FilenameSuffixesAccessor.FilenameSuffixesMutator, org.refcodes.mixin.FilenameSuffixesAccessor.FilenameSuffixesProperty
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
hasFilenameSuffix
(File aFile) Determines whether this factory may be responsible for a given file.default boolean
hasFilenameSuffix
(String aFilePath) Determines whether this factory may be responsible for a given file.default ResourceProperties
toProperties
(File aFile) Loads the properties from the givenFile
.default ResourceProperties
toProperties
(File aFile, char... aDelimiters) Loads the properties from the givenFile
.default ResourceProperties
toProperties
(File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator) Loads or seeks the properties from the givenFile
.toProperties
(File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters) Loads or seeks the properties from the givenFile
.default ResourceProperties
toProperties
(InputStream aInputStream) Reads the properties from the givenInputStream
.toProperties
(InputStream aInputStream, char... aDelimiters) Reads the properties from the givenInputStream
.default ResourceProperties
toProperties
(Class<?> aResourceClass, String aFilePath) Loads the properties from the given file's path.default ResourceProperties
toProperties
(Class<?> aResourceClass, String aFilePath, char... aDelimiters) Loads the properties from the given file's path.default ResourceProperties
toProperties
(Class<?> aResourceClass, String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator) Loads the properties from the given file's path.toProperties
(Class<?> aResourceClass, String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters) Loads the properties from the given file's path.toProperties
(Object aObj) Create aResourceProperties
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the path delimiter "/" (Delimiter.PATH
) for the path declarations: "Inspects the given object and adds all elements found in the given object.default ResourceProperties
toProperties
(String aFilePath) Loads the properties from the given file's path.default ResourceProperties
toProperties
(String aFilePath, char... aDelimiters) Loads the properties from the given file's path.default ResourceProperties
toProperties
(String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator) Loads the properties from the given file's path.toProperties
(String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters) Loads the properties from the given file's path.default ResourceProperties
toProperties
(URL aUrl) Loads the properties from the givenURL
.toProperties
(URL aUrl, char... aDelimiters) Loads the properties from the givenURL
.toProperties
(Map<?, ?> aProperties) Create aResourceProperties
instance containing the elements of the providedMap
instance using the path delimiter "/" (Delimiter.PATH
) for the path declarations.toProperties
(Properties aProperties) Create aResourceProperties
instance containing the elements of the providedProperties
instance using the path delimiter "/" (Delimiter.PATH
) for the path declarations.toProperties
(Properties.PropertiesBuilder aProperties) Create aResourceProperties
instance containing the elements of the providedProperties.PropertiesBuilder
instance using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.Methods inherited from interface org.refcodes.mixin.FilenameSuffixesAccessor
getFilenameSuffixes
-
Method Details
-
hasFilenameSuffix
Determines whether this factory may be responsible for a given file.- Parameters:
aFile
- The file which's suffix is to be tested.- Returns:
- True in case this factory may be responsible, else false.
-
hasFilenameSuffix
Determines whether this factory may be responsible for a given file.- Parameters:
aFilePath
- The path of the file which's suffix is to be tested.- Returns:
- True in case this factory may be responsible, else false.
-
toProperties
ResourceProperties toProperties(Class<?> aResourceClass, String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters) throws IOException, ParseException Loads the properties from the given file's path. A providedConfigLocator
describes the locations to additional crawl for the desired file. Finally (if nothing else succeeds) the properties are loaded by the provided class's class loader which takes care of loading the properties (in case the file path is a relative path, also the absolute path with a prefixed path delimiter "/" is probed).- Parameters:
aResourceClass
- The class which's class loader is to take care of loading the properties (from inside a JAR).aFilePath
- The file path of the class's resources from which to load the properties.aConfigLocator
- TheConfigLocator
describes the locations to additional crawl for the desired file.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
ResourceProperties toProperties(File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters) throws IOException, ParseException Loads or seeks the properties from the givenFile
. A providedConfigLocator
describes the locations to additional crawl for the desired file.- Parameters:
aFile
- TheFile
from which to load the properties.aConfigLocator
- TheConfigLocator
describes the locations to additional crawl for the desired file.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
ResourceProperties toProperties(InputStream aInputStream, char... aDelimiters) throws IOException, ParseException Reads the properties from the givenInputStream
.- Parameters:
aInputStream
- TheInputStream
from which to read the properties.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
Create aResourceProperties
instance containing the elements of the providedMap
instance using the path delimiter "/" (Delimiter.PATH
) for the path declarations.- Parameters:
aProperties
- the properties to be added.- Returns:
- The accordingly constructed
ResourceProperties
.
-
toProperties
Create aResourceProperties
instance containing the elements as ofPathMap.MutablePathMap.insert(Object)
using the path delimiter "/" (Delimiter.PATH
) for the path declarations: "Inspects the given object and adds all elements found in the given object. Elements of typeMap
,Collection
and arrays are identified and handled as of their type: The path for each value in aMap
is appended with its according key. The path for each value in aCollection
or array is appended with its according index of occurrence (in case of aList
or an array, its actual index). In case of reflection, the path for each member is appended with its according mamber's name. All elements (e.g. the members and values) are inspected recursively which results in the according paths of the terminating values."- Parameters:
aObj
- The object from which the elements are to be added.- Returns:
- The accordingly constructed
ResourceProperties
.
-
toProperties
Create aResourceProperties
instance containing the elements of the providedProperties
instance using the path delimiter "/" (Delimiter.PATH
) for the path declarations.- Parameters:
aProperties
- the properties to be added.- Returns:
- The accordingly constructed
ResourceProperties
.
-
toProperties
Create aResourceProperties
instance containing the elements of the providedProperties.PropertiesBuilder
instance using the default path delimiter "/" (Delimiter.PATH
) for the path declarations.- Parameters:
aProperties
- the properties to be added.- Returns:
- The accordingly constructed
ResourceProperties
.
-
toProperties
ResourceProperties toProperties(String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator, char... aDelimiters) throws IOException, ParseException Loads the properties from the given file's path. A providedConfigLocator
describes the locations to additional crawl for the desired file.- Parameters:
aFilePath
- The path to the file from which to load the properties.aConfigLocator
- TheConfigLocator
describes the locations to additional crawl for the desired file.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
Loads the properties from the givenURL
.- Parameters:
aUrl
- TheURL
from which to read the properties.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
default ResourceProperties toProperties(Class<?> aResourceClass, String aFilePath) throws IOException, ParseException Loads the properties from the given file's path.- Parameters:
aResourceClass
- The class which's class loader is to take care of loading the properties (from inside a JAR).aFilePath
- The file path of the class's resources from which to load the properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
default ResourceProperties toProperties(Class<?> aResourceClass, String aFilePath, char... aDelimiters) throws IOException, ParseException Loads the properties from the given file's path.- Parameters:
aResourceClass
- The class which's class loader is to take care of loading the properties (from inside a JAR).aFilePath
- The file path of the class's resources from which to load the properties.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
default ResourceProperties toProperties(Class<?> aResourceClass, String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator) throws IOException, ParseException Loads the properties from the given file's path. A providedConfigLocator
describes the locations to additional crawl for the desired file. Finally (if nothing else succeeds) the properties are loaded by the provided class's class loader which takes care of loading the properties (in case the file path is a relative path, also the absolute path with a prefixed path delimiter "/" is probed).- Parameters:
aResourceClass
- The class which's class loader is to take care of loading the properties (from inside a JAR).aFilePath
- The file path of the class's resources from which to load the properties.aConfigLocator
- TheConfigLocator
describes the locations to additional crawl for the desired file.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
Loads the properties from the givenFile
.- Parameters:
aFile
- TheFile
from which to load the properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
default ResourceProperties toProperties(File aFile, char... aDelimiters) throws IOException, ParseException Loads the properties from the givenFile
.- Parameters:
aFile
- TheFile
from which to load the properties.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
default ResourceProperties toProperties(File aFile, org.refcodes.runtime.ConfigLocator aConfigLocator) throws IOException, ParseException Loads or seeks the properties from the givenFile
. A providedConfigLocator
describes the locations to additional crawl for the desired file.- Parameters:
aFile
- TheFile
from which to load the properties.aConfigLocator
- TheConfigLocator
describes the locations to additional crawl for the desired file.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
default ResourceProperties toProperties(InputStream aInputStream) throws IOException, ParseException Reads the properties from the givenInputStream
.- Parameters:
aInputStream
- TheInputStream
from which to read the properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
Loads the properties from the given file's path.- Parameters:
aFilePath
- The path to the file from which to load the properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
default ResourceProperties toProperties(String aFilePath, char... aDelimiters) throws IOException, ParseException Loads the properties from the given file's path.- Parameters:
aFilePath
- The path to the file from which to load the properties.aDelimiters
- The path delimiters to be used when parsing the source's properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
default ResourceProperties toProperties(String aFilePath, org.refcodes.runtime.ConfigLocator aConfigLocator) throws IOException, ParseException Loads the properties from the given file's path. A providedConfigLocator
describes the locations to additional crawl for the desired file.- Parameters:
aFilePath
- The path to the file from which to load the properties.aConfigLocator
- TheConfigLocator
describes the locations to additional crawl for the desired file.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
toProperties
Loads the properties from the givenURL
.- Parameters:
aUrl
- TheURL
from which to read the properties.- Returns:
- The accordingly constructed
ResourceProperties
. - Throws:
IOException
- thrown in case accessing or processing the properties file failed.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-