javax.servlet
类 ServletSecurityElement

java.lang.Object
  继承者 javax.servlet.HttpConstraintElement
      继承者 javax.servlet.ServletSecurityElement

public class ServletSecurityElement
extends HttpConstraintElement

Java Class represntation of a ServletSecurity annotation value.

从以下版本开始:
Servlet 3.0

构造方法摘要
ServletSecurityElement()
          Constructs an instance using the default HttpConstraintElement value as the default Constraint element and with no HTTP Method specific constraint elements.
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.
ServletSecurityElement(HttpConstraintElement constraint)
          Constructs an instance with a default Constraint element and with no HTTP Method specific constraint elements.
ServletSecurityElement(HttpConstraintElement constraint, Collection<HttpMethodConstraintElement> methodConstraints)
          Constructs an instance with a default Constraint element and with a collection of HTTP Method specific constraint elements.
ServletSecurityElement(ServletSecurity annotation)
          Constructs an instance from a ServletSecurity annotation value.
 
方法摘要
 Collection<HttpMethodConstraintElement> getHttpMethodConstraints()
          Gets the (possibly empty) collection of HTTP Method specific constraint elements.
 Collection<String> getMethodNames()
          Gets the set of HTTP method names named by the HttpMethodConstraints.
 
从类 javax.servlet.HttpConstraintElement 继承的方法
getEmptyRoleSemantic, getRolesAllowed, getTransportGuarantee
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ServletSecurityElement

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


ServletSecurityElement

public ServletSecurityElement(HttpConstraintElement constraint)
Constructs an instance with a default Constraint element and with no HTTP Method specific constraint elements.

参数:
constraint - the HttpConstraintElement to be applied to all HTTP methods other than those represented in the methodConstraints

ServletSecurityElement

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.

参数:
methodConstraints - the collection of HTTP method specific constraint elements
抛出:
IllegalArgumentException - if duplicate method names are detected

ServletSecurityElement

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.

参数:
constraint - the HttpConstraintElement to be applied to all HTTP methods other than those represented in the methodConstraints
methodConstraints - the collection of HTTP method specific constraint elements.
抛出:
IllegalArgumentException - if duplicate method names are detected

ServletSecurityElement

public ServletSecurityElement(ServletSecurity annotation)
Constructs an instance from a ServletSecurity annotation value.

参数:
annotation - the annotation value
抛出:
IllegalArgumentException - if duplicate method names are detected
方法详细信息

getHttpMethodConstraints

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.

返回:
the (possibly empty) collection of HttpMethodConstraintElement objects

getMethodNames

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.

返回:
the collection String method names


Copyright © 2013. All Rights Reserved.