Top Description Fields Constructors Methods
jakarta.servlet

public Class HttpConstraintElement

extends Object
Class Inheritance
Known Direct Subclasses
jakarta.servlet.HttpMethodConstraintElement, jakarta.servlet.ServletSecurityElement
Imports
java.util.ResourceBundle, jakarta.servlet.annotation.ServletSecurity.EmptyRoleSemantic, .ServletSecurity.TransportGuarantee

Equivalent of jakarta.servlet.annotation.HttpConstraint for programmatic configuration of security constraints.
Since
Servlet 3.0

Field Summary

Modifier and TypeField and Description
private final ServletSecurity.EmptyRoleSemantic
private static final String
private static final ResourceBundle
private final String[]
private final ServletSecurity.TransportGuarantee

Constructor Summary

AccessConstructor and Description
public
HttpConstraintElement()

Default constraint is permit with no transport guarantee.

public
HttpConstraintElement(ServletSecurity.EmptyRoleSemantic
The empty role semantic to apply to the newly created constraint
emptyRoleSemantic
)

Construct a constraint with an empty role semantic.

public
HttpConstraintElement(ServletSecurity.TransportGuarantee
The transport guarantee to apply to the newly created constraint
transportGuarantee
,
String...
The roles to associate with the newly created constraint
rolesAllowed
)

Construct a constraint with a transport guarantee and roles.

public
HttpConstraintElement(ServletSecurity.EmptyRoleSemantic
The empty role semantic to apply to the newly created constraint
emptyRoleSemantic
,
ServletSecurity.TransportGuarantee
The transport guarantee to apply to the newly created constraint
transportGuarantee
,
String...
The roles to associate with the newly created constraint
rolesAllowed
)

Construct a constraint with an empty role semantic, a transport guarantee and roles.

Method Summary

Modifier and TypeMethod and Description
public ServletSecurity.EmptyRoleSemantic

Returns:

TODO
getEmptyRoleSemantic
()

TODO

public String[]

Returns:

TODO
getRolesAllowed
()

TODO

public ServletSecurity.TransportGuarantee

Returns:

TODO
getTransportGuarantee
()

TODO

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

emptyRoleSemanticback to summary
private final ServletSecurity.EmptyRoleSemantic emptyRoleSemantic
LSTRING_FILEback to summary
private static final String LSTRING_FILE
lStringsback to summary
private static final ResourceBundle lStrings
rolesAllowedback to summary
private final String[] rolesAllowed
transportGuaranteeback to summary
private final ServletSecurity.TransportGuarantee transportGuarantee

Constructor Detail

HttpConstraintElementback to summary
public HttpConstraintElement()

Default constraint is permit with no transport guarantee.

HttpConstraintElementback to summary
public HttpConstraintElement(ServletSecurity.EmptyRoleSemantic emptyRoleSemantic)

Construct a constraint with an empty role semantic. Typically used with EmptyRoleSemantic#DENY.

Parameters
emptyRoleSemantic:ServletSecurity.EmptyRoleSemantic

The empty role semantic to apply to the newly created constraint

HttpConstraintElementback to summary
public HttpConstraintElement(ServletSecurity.TransportGuarantee transportGuarantee, String... rolesAllowed)

Construct a constraint with a transport guarantee and roles.

Parameters
transportGuarantee:ServletSecurity.TransportGuarantee

The transport guarantee to apply to the newly created constraint

rolesAllowed:String[]

The roles to associate with the newly created constraint

HttpConstraintElementback to summary
public HttpConstraintElement(ServletSecurity.EmptyRoleSemantic emptyRoleSemantic, ServletSecurity.TransportGuarantee transportGuarantee, String... rolesAllowed)

Construct a constraint with an empty role semantic, a transport guarantee and roles.

Parameters
emptyRoleSemantic:ServletSecurity.EmptyRoleSemantic

The empty role semantic to apply to the newly created constraint

transportGuarantee:ServletSecurity.TransportGuarantee

The transport guarantee to apply to the newly created constraint

rolesAllowed:String[]

The roles to associate with the newly created constraint

Exceptions
IllegalArgumentException:
if roles are specified when DENY is used

Method Detail

getEmptyRoleSemanticback to summary
public ServletSecurity.EmptyRoleSemantic getEmptyRoleSemantic()

TODO

Returns:ServletSecurity.EmptyRoleSemantic

TODO

getRolesAllowedback to summary
public String[] getRolesAllowed()

TODO

Returns:String[]

TODO

getTransportGuaranteeback to summary
public ServletSecurity.TransportGuarantee getTransportGuarantee()

TODO

Returns:ServletSecurity.TransportGuarantee

TODO