java.lang.Object
se.swedenconnect.opensaml.common.builder.AbstractSAMLObjectBuilder<org.opensaml.core.xml.XMLObject>
se.swedenconnect.opensaml.saml2.metadata.build.ScopeBuilder
All Implemented Interfaces:
SAMLObjectBuilder<org.opensaml.core.xml.XMLObject>

public class ScopeBuilder extends AbstractSAMLObjectBuilder<org.opensaml.core.xml.XMLObject>
Builder for Scope elements.

Since this class is also defined in Shibboleth's idp-saml-api and idp-saml-impl libraries we create only a SAMLObject and depending on if the user has Shibboleth in the classpath an object of the net.shibboleth.idp.saml.xmlobject.Scope or se.swedenconnect.opensaml.saml2.metadata.scope.Scope is created.

Author:
Martin Lindström (martin@idsec.se)
  • Constructor Details

    • ScopeBuilder

      public ScopeBuilder()
  • Method Details

    • builder

      public static ScopeBuilder builder()
      Creates a new ScopeBuilder instance.
      Returns:
      a ScopeBuilder instance
    • regexp

      public ScopeBuilder regexp(Boolean regexp)
      Assigns the regexp attribute.
      Parameters:
      regexp - the regexp attribute
      Returns:
      the builder
    • value

      public ScopeBuilder value(String value)
      Assigns the value.
      Parameters:
      value - the value
      Returns:
      the builder
    • build

      public <T> T build(Class<T> clazz)
      Builds and casts to the correct Scope type.
      Type Parameters:
      T - the Scope type to cast to
      Parameters:
      clazz - the Scope type to cast to
      Returns:
      a Scope object
    • getObjectType

      protected Class<org.opensaml.core.xml.XMLObject> getObjectType()
      Returns the object type.
      Specified by:
      getObjectType in class AbstractSAMLObjectBuilder<org.opensaml.core.xml.XMLObject>
      Returns:
      the object type
    • getDefaultElementName

      protected QName getDefaultElementName()
      Gets the default element name for the object.
      Overrides:
      getDefaultElementName in class AbstractSAMLObjectBuilder<org.opensaml.core.xml.XMLObject>
      Returns:
      a QName