Class AbstractResourcePropertyConverter<T>
java.lang.Object
se.swedenconnect.security.credential.spring.converters.AbstractResourcePropertyConverter<T>
- All Implemented Interfaces:
Aware
,ApplicationContextAware
,Converter<String,
T>
- Direct Known Subclasses:
PropertyToPrivateKeyConverter
,PropertyToPublicKeyConverter
,PropertyToX509CertificateConverter
public abstract class AbstractResourcePropertyConverter<T>
extends Object
implements Converter<String,T>, ApplicationContextAware
Abstract base class for converters that convert a resource property value into an object.
- Author:
- Martin Lindström
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract T
convert
(InputStream inputStream) Converts the input stream to the object supported by the converter.protected abstract boolean
isInlinedPem
(String property) Tells whether the property value holds an "inlined" PEM representation of the object.void
setApplicationContext
(ApplicationContext applicationContext)
-
Constructor Details
-
AbstractResourcePropertyConverter
public AbstractResourcePropertyConverter()
-
-
Method Details
-
convert
-
convert
Converts the input stream to the object supported by the converter.The stream must not be closed.
- Parameters:
inputStream
- the stream- Returns:
- the object
- Throws:
Exception
- for conversion errors
-
isInlinedPem
Tells whether the property value holds an "inlined" PEM representation of the object.- Parameters:
property
- the property value- Returns:
true
if the property holds a PEM object, andfalse
otherwise
-
setApplicationContext
public void setApplicationContext(@Nonnull ApplicationContext applicationContext) throws BeansException - Specified by:
setApplicationContext
in interfaceApplicationContextAware
- Throws:
BeansException
-