Class AbstractSAMLObjectBuilder<T extends org.opensaml.core.xml.XMLObject>
java.lang.Object
se.swedenconnect.opensaml.common.builder.AbstractSAMLObjectBuilder<T>
- Type Parameters:
T
- the type
- All Implemented Interfaces:
SAMLObjectBuilder<T>
- Direct Known Subclasses:
AbstractRequestBuilder
,AbstractSSODescriptorBuilder
,AssertionConsumerServiceBuilder
,AttributeBuilder
,AttributeConsumingServiceBuilder
,ContactPersonBuilder
,DigestMethodBuilder
,DiscoveryResponseBuilder
,EncryptionMethodBuilder
,EntityAttributesBuilder
,EntityDescriptorBuilder
,ExtensionsBuilder
,ExtensionsBuilder
,KeyDescriptorBuilder
,LogoBuilder
,NameIDPolicyBuilder
,OrganizationBuilder
,RequestedAttributeBuilder
,RequestedAuthnContextBuilder
,ScopeBuilder
,ScopingBuilder
,SigningMethodBuilder
,SingleLogoutServiceBuilder
,SingleSignOnServiceBuilder
,UIInfoBuilder
public abstract class AbstractSAMLObjectBuilder<T extends org.opensaml.core.xml.XMLObject>
extends Object
implements SAMLObjectBuilder<T>
Abstract base class for the builder pattern.
- Author:
- Martin Lindström (martin@idsec.se)
-
Constructor Summary
ConstructorDescriptionConstructor setting up the object to build.AbstractSAMLObjectBuilder
(InputStream resource) Constructor setting up the builder with a template object that is read from an input stream.AbstractSAMLObjectBuilder
(T template) Constructor setting up the builder with a template object.AbstractSAMLObjectBuilder
(T template, boolean clone) Constructor setting up the builder with a template object. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
The default implementation of this method assumes that the object has been built during assignment of its attributes and elements so it simply returns the object.protected QName
Gets the default element name for the object.Returns the object type.final T
object()
Returns the object being built.
-
Constructor Details
-
AbstractSAMLObjectBuilder
public AbstractSAMLObjectBuilder()Constructor setting up the object to build. -
AbstractSAMLObjectBuilder
Constructor setting up the builder with a template object. Users of the instance may now change, add or delete, the elements and attributes of the template object using the assignment methods of the builder.Maps to
AbstractSAMLObjectBuilder(XMLObject, boolean)
with theclone
parameter set totrue
.- Parameters:
template
- the template object- Throws:
SAMLObjectBuilderRuntimeException
- for marshalling/unmarshalling errors
-
AbstractSAMLObjectBuilder
public AbstractSAMLObjectBuilder(T template, boolean clone) throws SAMLObjectBuilderRuntimeException Constructor setting up the builder with a template object. Users of the instance may now change, add or delete, the elements and attributes of the template object using the assignment methods of the builder.The
clone
parameter tells whether the object should be cloned or not. If set totrue
, any modifications will have no effect on the passed object.- Parameters:
template
- the template objectclone
- whether the template object should be cloned- Throws:
SAMLObjectBuilderRuntimeException
- for marshalling/unmarshalling errors
-
AbstractSAMLObjectBuilder
public AbstractSAMLObjectBuilder(InputStream resource) throws net.shibboleth.shared.xml.XMLParserException, org.opensaml.core.xml.io.UnmarshallingException Constructor setting up the builder with a template object that is read from an input stream. Users of the instance may now change, add or delete, the elements and attributes of the template object using the assignment methods of the builder.- Parameters:
resource
- the template resource- Throws:
org.opensaml.core.xml.io.UnmarshallingException
- for unmarshalling errorsnet.shibboleth.shared.xml.XMLParserException
- for XML parsing errors
-
-
Method Details
-
build
The default implementation of this method assumes that the object has been built during assignment of its attributes and elements so it simply returns the object.Implementations that need to perform additional processing during the build step should override this method.
- Specified by:
build
in interfaceSAMLObjectBuilder<T extends org.opensaml.core.xml.XMLObject>
- Returns:
- the built object
-
getObjectType
Returns the object type.- Returns:
- the object type
-
object
Returns the object being built.- Returns:
- the object
-
getDefaultElementName
Gets the default element name for the object.- Returns:
- a QName
-