Class PropertyToEntityDescriptorConverter

java.lang.Object
se.swedenconnect.signservice.authn.saml.spring.PropertyToEntityDescriptorConverter
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.core.convert.converter.Converter<String,org.opensaml.saml.saml2.metadata.EntityDescriptor>

public class PropertyToEntityDescriptorConverter extends Object implements org.springframework.core.convert.converter.Converter<String,org.opensaml.saml.saml2.metadata.EntityDescriptor>, org.springframework.context.ApplicationContextAware
A Converter that gets the property value (e.g., classpath:metadata.xml) and instantiates an EntityDescriptor object.

To use this converter it has to be instantiated as a bean and then registered in the registry using ConverterRegistry.addConverter(Converter).

If you are using Spring Boot, do:

 @Bean
 @ConfigurationPropertiesBinding
 public PropertyToEntityDescriptorConverter propertyToEntityDescriptorConverter() {
   return new PropertyToEntityDescriptorConverter();
 }
 
  • Constructor Details

    • PropertyToEntityDescriptorConverter

      public PropertyToEntityDescriptorConverter()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(@Nonnull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • convert

      @Nonnull public org.opensaml.saml.saml2.metadata.EntityDescriptor convert(@Nonnull String source)
      Specified by:
      convert in interface org.springframework.core.convert.converter.Converter<String,org.opensaml.saml.saml2.metadata.EntityDescriptor>