Class EncryptablePropertySourceWrapper<T>
java.lang.Object
org.springframework.core.env.PropertySource<T>
com.ulisesbocchio.jasyptspringboot.wrapper.EncryptablePropertySourceWrapper<T>
- All Implemented Interfaces:
EncryptablePropertySource<T>,org.springframework.boot.origin.OriginLookup<String>
public class EncryptablePropertySourceWrapper<T>
extends org.springframework.core.env.PropertySource<T>
implements EncryptablePropertySource<T>
Wrapper for PropertySource instances that simply delegates the getProperty(java.lang.String) method
to the PropertySource delegate instance to retrieve properties, while checking if the resulting
property is encrypted or not using the Jasypt convention of surrounding encrypted values with "ENC()".
When an encrypted property is detected, it is decrypted using the provided StringEncryptor
- Version:
- $Id: $Id
- Author:
- Ulises Bocchio
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.core.env.PropertySource
org.springframework.core.env.PropertySource.StubPropertySource -
Field Summary
Fields inherited from class org.springframework.core.env.PropertySource
logger, name, source -
Constructor Summary
ConstructorsConstructorDescriptionEncryptablePropertySourceWrapper(org.springframework.core.env.PropertySource<T> delegate, EncryptablePropertyResolver resolver, EncryptablePropertyFilter filter) Constructor for EncryptablePropertySourceWrapper. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.core.env.PropertySource<T>getDelegate.getProperty(String name) getProperty.Methods inherited from class org.springframework.core.env.PropertySource
containsProperty, equals, getName, getSource, hashCode, named, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource
getOrigin, getPrefix, getProperty, isImmutable, refresh
-
Constructor Details
-
EncryptablePropertySourceWrapper
public EncryptablePropertySourceWrapper(org.springframework.core.env.PropertySource<T> delegate, EncryptablePropertyResolver resolver, EncryptablePropertyFilter filter) Constructor for EncryptablePropertySourceWrapper.
- Parameters:
delegate- aPropertySourceobjectresolver- aEncryptablePropertyResolverobjectfilter- aEncryptablePropertyFilterobject
-
-
Method Details
-
getProperty
getProperty.
- Specified by:
getPropertyin interfaceEncryptablePropertySource<T>- Specified by:
getPropertyin classorg.springframework.core.env.PropertySource<T>- Parameters:
name- aStringobject- Returns:
- a
Objectobject
-
getDelegate
getDelegate.
- Specified by:
getDelegatein interfaceEncryptablePropertySource<T>- Returns:
- a
PropertySourceobject
-