Package io.urf.config.urf
Class UrfConfiguration
java.lang.Object
io.confound.config.AbstractConfiguration
io.confound.config.BaseConfiguration<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.Section
Configuration implementation backed by an URF object graph.
- Author:
- Garret Wilson
- See Also:
-
Field Summary
Fields inherited from interface io.confound.config.Configuration
KEY_SEGMENT_SEPARATOR, KEY_SEGMENTS_PATTERN -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUrfConfiguration(io.confound.config.Configuration sectionRoot, Object root) Root configuration and URF object graph root constructor.UrfConfiguration(Object root) URF object graph root constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected <O> Optional<O>convertValue(Optional<Object> value, Class<O> convertClass) io.confound.config.ConfigurationMethods inherited from class io.confound.config.AbstractObjectConfiguration
findBoolean, findDouble, findInt, findLong, findPath, findSection, findString, findUriMethods inherited from class io.confound.config.BaseConfiguration
findCollection, findConfigurationValue, findObject, hasConfigurationValue, hasConfigurationValueImpl, normalizeKeyMethods inherited from class io.confound.config.AbstractConfiguration
orMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 Details
-
UrfConfiguration
URF object graph root constructor.- Parameters:
root- The root object of the URF object graph.- Throws:
NullPointerException- if the given root object isnull.
-
UrfConfiguration
protected UrfConfiguration(@Nullable io.confound.config.Configuration sectionRoot, @Nonnull 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:
NullPointerException- if the given root object isnull.
-
-
Method Details
-
getSectionRoot
public io.confound.config.Configuration getSectionRoot()- Specified by:
getSectionRootin interfaceio.confound.config.Section
-
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 Optional<Object> findConfigurationValueImpl(String key) throws io.confound.config.ConfigurationException - Specified by:
findConfigurationValueImplin classio.confound.config.BaseConfiguration<Object>- Throws:
IllegalArgumentException- if the given key has subsequent delimiters, such as"foo..bar".io.confound.config.ConfigurationException
-
convertValue
protected <O> Optional<O> convertValue(Optional<Object> value, 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
-