Package se.litsec.opensaml.core.spring
Class AbstractSAMLObjectBuilderFactoryBean<T extends SAMLObject>
- java.lang.Object
-
- org.springframework.beans.factory.config.AbstractFactoryBean<T>
-
- se.litsec.opensaml.core.spring.AbstractSAMLObjectBuilderFactoryBean<T>
-
- Type Parameters:
T- the type
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<T>,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
AbstractEntityDescriptorFactoryBean,AssertionConsumerServiceFactoryBean,ContactPersonFactoryBean,DigestMethodFactoryBean,EncryptionMethodFactoryBean,KeyDescriptorFactoryBean,LogoFactoryBean,OrganizationFactoryBean,SigningMethodFactoryBean,SingleSignOnServiceFactoryBean,UIInfoFactoryBean
public abstract class AbstractSAMLObjectBuilderFactoryBean<T extends SAMLObject> extends org.springframework.beans.factory.config.AbstractFactoryBean<T>Abstract base class for factory beans that are implemented using the builder pattern defined inSAMLObjectBuilderinterface.- Author:
- Martin Lindström (martin.lindstrom@litsec.se)
-
-
Constructor Summary
Constructors Constructor Description AbstractSAMLObjectBuilderFactoryBean()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract AbstractSAMLObjectBuilder<T>builder()Returns the builder.protected TcreateInstance()The default implementation assumes that the object has been set up when elements and attributes were assigned, and simply returns the build object (if this is not a singleton bean, the object is cloned).protected static LocalizedString[]localizedStringListToVarArgs(List<LocalizedString> list)Utility method that transforms a list ofLocalizedStringobjects into a varargs array (for usage in calls to builder instances).protected static String[]stringListToVarArgs(List<String> list)Utility method that transforms a list ofStringobjects into a varargs array (for usage in calls to builder instances).protected static <V> V[]toVarArgs(List<V> list, Class<V> cls)Utility method that transforms a list into a varargs array (for usage in calls to builder instances).
-
-
-
Method Detail
-
createInstance
protected T createInstance() throws Exception
The default implementation assumes that the object has been set up when elements and attributes were assigned, and simply returns the build object (if this is not a singleton bean, the object is cloned).- Specified by:
createInstancein classorg.springframework.beans.factory.config.AbstractFactoryBean<T extends SAMLObject>- Throws:
Exception
-
builder
protected abstract AbstractSAMLObjectBuilder<T> builder()
Returns the builder.- Returns:
- the builder
-
toVarArgs
protected static <V> V[] toVarArgs(List<V> list, Class<V> cls)
Utility method that transforms a list into a varargs array (for usage in calls to builder instances).- Type Parameters:
V- the type of objects stored in the array- Parameters:
list- the list to transformcls- the type of elements in the list- Returns:
- an array
-
localizedStringListToVarArgs
protected static LocalizedString[] localizedStringListToVarArgs(List<LocalizedString> list)
Utility method that transforms a list ofLocalizedStringobjects into a varargs array (for usage in calls to builder instances).- Parameters:
list- the list to transform- Returns:
- an array
-
-