Package org.frankframework.util
Interface AdditionalStringResolver
- All Known Implementing Classes:
CredentialResolver
,MessageToStringResolver
public interface AdditionalStringResolver
Interface to be implemented by framework-classes that provide extra property-resolving sources, such as credentials, which cannot be directly included of the
StringResolver
methods.
Implementors of the interface should have a no-args constructor and not need any injected dependencies. The StringResolver
will create instances
of each class that implements this interface, and invoke it from StringResolver.substVars(String, Map, Map, Set, String, String, boolean)
.
Implementors are loaded via the JDK ServiceLoader
mechanism.
It is not allowed to use a static reference to the logger in implementations. Log4j2 uses StringResolver during instantiation.
-
Method Summary
-
Method Details
-
resolve
Optional<String> resolve(String key, Map<?, ?> props1, Map<?, ?> props2, Set<String> propsToHide, String delimStart, String delimStop, boolean resolveWithPropertyName) Method to implement string resolution.Parameters are mostly as from
StringResolver.substVars(String, Map, Map, Set, String, String, boolean)
, except the first parameter,key
, which is the key to be resolved instead of the full string in which to substitute.- Parameters:
key
- Key to look upprops1
- First property map in which to look up valuesprops2
- Second property map in which to look up valuespropsToHide
- List of properties to hide. Ifnull
, then no hiding of properties should be done. If notnull
, any properties whose name is in the collection will be hidden by the caller but the implementation may make its own decision on hiding property values. For instance, hiding credentials.delimStart
- Start delimiter, normally only needed by callerdelimStop
- End delimiter, normally only needed by callerresolveWithPropertyName
- Flag if values should be prefixed with name of resolved property, normally only needed by caller.- Returns:
- Resolved property value, or
Optional.empty()
if it cannot be resolved by this implementation. IfOptional.empty()
is returned, theStringResolver
will then continue to try resolving thekey
. If any non-emptyOptional
is returned, theStringResolver
will use the value of that as value for thekey
and not look for other resolutions for the key.
-