Top Description Fields Constructors Methods
javax.servlet

public Class ServletSecurityElement

extends HttpConstraintElement
Class Inheritance
Imports
java.util.*, javax.servlet.annotation.HttpMethodConstraint, .ServletSecurity

Java Class representation of a ServletSecurity annotation value.
Since
Servlet 3.0

Field Summary

Modifier and TypeField and Description
private Collection<HttpMethodConstraintElement>
private Collection<String>

Constructor Summary

AccessConstructor and Description
public
ServletSecurityElement()

Constructs an instance using the default HttpConstraintElement value as the default Constraint element and with no HTTP Method specific constraint elements.

public
ServletSecurityElement(HttpConstraintElement
the HttpConstraintElement to be applied to all HTTP methods other than those represented in the methodConstraints
constraint
)

Constructs an instance with a default Constraint element and with no HTTP Method specific constraint elements.

public
ServletSecurityElement(Collection<HttpMethodConstraintElement>
the collection of HTTP method specific constraint elements
methodConstraints
)

Constructs an instance using the default HttpConstraintElement value as the default Constraint element and with a collection of HTTP Method specific constraint elements.

public
ServletSecurityElement(HttpConstraintElement
the HttpConstraintElement to be applied to all HTTP methods other than those represented in the methodConstraints
constraint
,
Collection<HttpMethodConstraintElement>
the collection of HTTP method specific constraint elements.
methodConstraints
)

Constructs an instance with a default Constraint element and with a collection of HTTP Method specific constraint elements.

public
ServletSecurityElement(ServletSecurity
the annotation value
annotation
)

Constructs an instance from a ServletSecurity annotation value.

Method Summary

Modifier and TypeMethod and Description
private Collection<String>

Returns:

Set of method names
checkMethodNames
(Collection<HttpMethodConstraintElement> methodConstraints)

Checks for duplicate method names in methodConstraints.

public Collection<HttpMethodConstraintElement>

Returns:

the (possibly empty) collection of HttpMethodConstraintElement objects
getHttpMethodConstraints
()

Gets the (possibly empty) collection of HTTP Method specific constraint elements.

public Collection<String>

Returns:

the collection String method names
getMethodNames
()

Gets the set of HTTP method names named by the HttpMethodConstraints.

Inherited from javax.servlet.HttpConstraintElement:
getEmptyRoleSemanticgetRolesAllowedgetTransportGuarantee

Field Detail

methodConstraintsback to summary
private Collection<HttpMethodConstraintElement> methodConstraints
methodNamesback to summary
private Collection<String> methodNames

Constructor Detail

ServletSecurityElementback to summary
public ServletSecurityElement()

Constructs an instance using the default HttpConstraintElement value as the default Constraint element and with no HTTP Method specific constraint elements.

ServletSecurityElementback to summary
public ServletSecurityElement(HttpConstraintElement constraint)

Constructs an instance with a default Constraint element and with no HTTP Method specific constraint elements.

Parameters
constraint:HttpConstraintElement

the HttpConstraintElement to be applied to all HTTP methods other than those represented in the methodConstraints

ServletSecurityElementback to summary
public ServletSecurityElement(Collection<HttpMethodConstraintElement> methodConstraints)

Constructs an instance using the default HttpConstraintElement value as the default Constraint element and with a collection of HTTP Method specific constraint elements.

Parameters
methodConstraints:Collection<HttpMethodConstraintElement>

the collection of HTTP method specific constraint elements

Exceptions
IllegalArgumentException:
if duplicate method names are detected
ServletSecurityElementback to summary
public ServletSecurityElement(HttpConstraintElement constraint, Collection<HttpMethodConstraintElement> methodConstraints)

Constructs an instance with a default Constraint element and with a collection of HTTP Method specific constraint elements.

Parameters
constraint:HttpConstraintElement

the HttpConstraintElement to be applied to all HTTP methods other than those represented in the methodConstraints

methodConstraints:Collection<HttpMethodConstraintElement>

the collection of HTTP method specific constraint elements.

Exceptions
IllegalArgumentException:
if duplicate method names are detected
ServletSecurityElementback to summary
public ServletSecurityElement(ServletSecurity annotation)

Constructs an instance from a ServletSecurity annotation value.

Parameters
annotation:ServletSecurity

the annotation value

Exceptions
IllegalArgumentException:
if duplicate method names are detected

Method Detail

checkMethodNamesback to summary
private Collection<String> checkMethodNames(Collection<HttpMethodConstraintElement> methodConstraints)

Checks for duplicate method names in methodConstraints.

Returns:Collection<String>

Set of method names

Exceptions
IllegalArgumentException:
if duplicate method names are detected
getHttpMethodConstraintsback to summary
public Collection<HttpMethodConstraintElement> getHttpMethodConstraints()

Gets the (possibly empty) collection of HTTP Method specific constraint elements.

If permitted, any changes to the returned Collection must not affect this ServletSecurityElement.

Returns:Collection<HttpMethodConstraintElement>

the (possibly empty) collection of HttpMethodConstraintElement objects

getMethodNamesback to summary
public Collection<String> getMethodNames()

Gets the set of HTTP method names named by the HttpMethodConstraints.

If permitted, any changes to the returned Collection must not affect this ServletSecurityElement.

Returns:Collection<String>

the collection String method names