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
PropertySourceinstances that simply delegates thegetProperty(java.lang.String)method to thePropertySourcedelegate 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
-
-
Constructor Summary
Constructors Constructor Description EncryptablePropertySourceWrapper(org.springframework.core.env.PropertySource<T> delegate, EncryptablePropertyResolver resolver, EncryptablePropertyFilter filter)Constructor for EncryptablePropertySourceWrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.core.env.PropertySource<T>getDelegate()getDelegate.ObjectgetProperty(String name)getProperty.-
Methods inherited from class org.springframework.core.env.PropertySource
containsProperty, equals, getName, getSource, hashCode, named, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource
getOrigin, getPrefix, getProperty, isImmutable, refresh
-
-
-
-
Constructor Detail
-
EncryptablePropertySourceWrapper
public EncryptablePropertySourceWrapper(org.springframework.core.env.PropertySource<T> delegate, EncryptablePropertyResolver resolver, EncryptablePropertyFilter filter)
Constructor for EncryptablePropertySourceWrapper.
- Parameters:
delegate- aPropertySourceobjectresolver- aEncryptablePropertyResolverobjectfilter- aEncryptablePropertyFilterobject
-
-
Method Detail
-
getProperty
public Object getProperty(String name)
getProperty.
- Specified by:
getPropertyin interfaceEncryptablePropertySource<T>- Specified by:
getPropertyin classorg.springframework.core.env.PropertySource<T>- Parameters:
name- aStringobject- Returns:
- a
Objectobject
-
getDelegate
public org.springframework.core.env.PropertySource<T> getDelegate()
getDelegate.
- Specified by:
getDelegatein interfaceEncryptablePropertySource<T>- Returns:
- a
PropertySourceobject
-
-