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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Tconvert(InputStream inputStream) Converts the input stream to the object supported by the converter.protected abstract booleanisInlinedPem(String property) Tells whether the property value holds an "inlined" PEM representation of the object.voidsetApplicationContext(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:
trueif the property holds a PEM object, andfalseotherwise
-
setApplicationContext
public void setApplicationContext(@Nonnull ApplicationContext applicationContext) throws BeansException - Specified by:
setApplicationContextin interfaceApplicationContextAware- Throws:
BeansException
-