Package io.urf.config.urf
Class UrfConfiguration
- java.lang.Object
-
- io.confound.config.AbstractConfiguration
-
- io.confound.config.BaseConfiguration<java.lang.Object>
-
- io.confound.config.AbstractObjectConfiguration
-
- io.urf.config.urf.UrfConfiguration
-
- All Implemented Interfaces:
io.confound.config.Configuration,io.confound.config.Section
public class UrfConfiguration extends io.confound.config.AbstractObjectConfiguration implements io.confound.config.SectionConfiguration implementation backed by an URF object graph.- Author:
- Garret Wilson
- See Also:
- Uniform Resource Framework (URF)
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUrfConfiguration(io.confound.config.Configuration sectionRoot, java.lang.Object root)Root configuration and URF object graph root constructor.UrfConfiguration(java.lang.Object root)URF object graph root constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <O> java.util.Optional<O>convertValue(java.util.Optional<java.lang.Object> value, java.lang.Class<O> convertClass)protected java.util.Optional<java.lang.Object>findConfigurationValueImpl(java.lang.String key)io.confound.config.ConfigurationgetSectionRoot()java.util.Optional<java.lang.String>getSectionType()-
Methods inherited from class io.confound.config.AbstractObjectConfiguration
findBoolean, findDouble, findInt, findLong, findPath, findSection, findString, findUri
-
Methods inherited from class io.confound.config.BaseConfiguration
findCollection, findConfigurationValue, findObject, hasConfigurationValue, hasConfigurationValueImpl, normalizeKey
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.confound.config.Configuration
createMissingConfigurationKeyException, findBoolean, findCollection, findCollection, findDouble, findInt, findLong, findObject, findObject, findPath, findSection, findString, findUri, getBoolean, getCollection, getCollection, getDouble, getInt, getLong, getObject, getObject, getPath, getSection, getString, getUri, hasConfigurationValue, requireConfiguration, resolvePath, subConfiguration, superConfiguration, withFallback
-
-
-
-
Constructor Detail
-
UrfConfiguration
public UrfConfiguration(@Nonnull java.lang.Object root)URF object graph root constructor.- Parameters:
root- The root object of the URF object graph.- Throws:
java.lang.NullPointerException- if the given root object isnull.
-
UrfConfiguration
protected UrfConfiguration(@Nullable io.confound.config.Configuration sectionRoot, @Nonnull java.lang.Object root)Root configuration and URF object graph root constructor.- Parameters:
sectionRoot- A reference to the root configuration for the section, ornullif this configuration is the section root.root- The root object of the URF object graph.- Throws:
java.lang.NullPointerException- if the given root object isnull.
-
-
Method Detail
-
getSectionRoot
public io.confound.config.Configuration getSectionRoot()
- Specified by:
getSectionRootin interfaceio.confound.config.Section
-
getSectionType
public java.util.Optional<java.lang.String> getSectionType()
- Specified by:
getSectionTypein interfaceio.confound.config.Section- Implementation Specification:
- This implementation returns the handle of the root object, if the root object is an
UrfObjectand has a type that can be represented as a handle. If the root object has a type that cannot be represented as a handle, it is returned as the string form of its tag.
-
findConfigurationValueImpl
protected java.util.Optional<java.lang.Object> findConfigurationValueImpl(java.lang.String key) throws io.confound.config.ConfigurationException- Specified by:
findConfigurationValueImplin classio.confound.config.BaseConfiguration<java.lang.Object>- Throws:
java.lang.IllegalArgumentException- if the given key has subsequent delimiters, such as"foo..bar".io.confound.config.ConfigurationException
-
convertValue
protected <O> java.util.Optional<O> convertValue(java.util.Optional<java.lang.Object> value, java.lang.Class<O> convertClass) throws io.confound.config.ConfigurationException- Overrides:
convertValuein classio.confound.config.AbstractObjectConfiguration- Implementation Specification:
- This version adds the ability to do the following conversions:
- Converts
Stringvalue from the URF model to aPathusingPaths.get(String, String...)with aPathis requested. - Converts an
UrfObjectto aSectionwhen anUrfConfigurationor any super class is requested. This means, for example, that merely requestingObject.classwill convert anUrfObjectto aSection. The only way to retrieve anUrfObjectnode would be to requestUrfObject.classexplicitly.
- Converts
- Throws:
io.confound.config.ConfigurationException
-
-