O
- The Object being built by BB
- The Builder that is building O and is configured by
SecurityConfigurerAdapter
public abstract class SecurityConfigurerAdapter<O,B extends SecurityBuilder<O>> extends java.lang.Object implements SecurityConfigurer<O,B>
SecurityConfigurer
that allows subclasses to only implement
the methods they are interested in. It also provides a mechanism for using the
SecurityConfigurer
and when done gaining access to the SecurityBuilder
that is being configured.Constructor and Description |
---|
SecurityConfigurerAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
addObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor)
Adds an
ObjectPostProcessor to be used for this
SecurityConfigurerAdapter . |
B |
and()
Return the
SecurityBuilder when done using the SecurityConfigurer . |
void |
configure(B builder)
Configure the
SecurityBuilder by setting the necessary properties on the
SecurityBuilder . |
protected B |
getBuilder()
Gets the
SecurityBuilder . |
void |
init(B builder)
Initialize the
SecurityBuilder . |
protected <T> T |
postProcess(T object)
Performs post processing of an object.
|
void |
setBuilder(B builder)
Sets the
SecurityBuilder to be used. |
public void init(B builder) throws java.lang.Exception
SecurityConfigurer
SecurityBuilder
. Here only shared state should be created
and modified, but not properties on the SecurityBuilder
used for building
the object. This ensures that the SecurityConfigurer.configure(SecurityBuilder)
method uses
the correct shared objects when building.init
in interface SecurityConfigurer<O,B extends SecurityBuilder<O>>
java.lang.Exception
public void configure(B builder) throws java.lang.Exception
SecurityConfigurer
SecurityBuilder
by setting the necessary properties on the
SecurityBuilder
.configure
in interface SecurityConfigurer<O,B extends SecurityBuilder<O>>
java.lang.Exception
public B and()
SecurityBuilder
when done using the SecurityConfigurer
.
This is useful for method chaining.protected final B getBuilder()
SecurityBuilder
. Cannot be null.SecurityBuilder
java.lang.IllegalStateException
- if SecurityBuilder
is nullprotected <T> T postProcess(T object)
ObjectPostProcessor
.object
- the Object to post processpublic void addObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor)
ObjectPostProcessor
to be used for this
SecurityConfigurerAdapter
. The default implementation does nothing to the
object.objectPostProcessor
- the ObjectPostProcessor
to usepublic void setBuilder(B builder)
SecurityBuilder
to be used. This is automatically set when using
AbstractConfiguredSecurityBuilder.apply(SecurityConfigurerAdapter)
builder
- the SecurityBuilder
to set