类 AdaptPermission
- java.lang.Object
-
- java.security.Permission
-
- java.security.BasicPermission
-
- org.osgi.framework.AdaptPermission
-
- 所有已实现的接口:
java.io.Serializable,java.security.Guard
public final class AdaptPermission extends java.security.BasicPermissionA bundle's authority to adapt an object to a type.AdaptPermissionhas one action:adapt.- 作者:
- $Id: 9f0866e633ce08566547b4955a2ece54c46944e0 $
- 另请参阅:
- 序列化表格
-
-
字段概要
字段 修饰符和类型 字段 说明 static java.lang.StringADAPTThe action stringinitiate.
-
构造器概要
构造器 构造器 说明 AdaptPermission(java.lang.String filter, java.lang.String actions)Creates a new grantedAdaptPermissionobject.AdaptPermission(java.lang.String adaptClass, Bundle adaptableBundle, java.lang.String actions)Creates a new requestedAdaptPermissionobject to be used by the code that must performcheckPermission.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanequals(java.lang.Object obj)Determines the equality of twoAdaptPermissionobjects.java.lang.StringgetActions()Returns the canonical string representation of theAdaptPermissionactions.inthashCode()Returns the hash code value for this object.booleanimplies(java.security.Permission p)Determines if the specified permission is implied by this object.java.security.PermissionCollectionnewPermissionCollection()Returns a newPermissionCollectionobject suitable for storingAdaptPermissionobjects.
-
-
-
字段详细资料
-
ADAPT
public static final java.lang.String ADAPT
The action stringinitiate.- 另请参阅:
- 常量字段值
-
-
构造器详细资料
-
AdaptPermission
public AdaptPermission(java.lang.String filter, java.lang.String actions)Creates a new grantedAdaptPermissionobject. This constructor must only be used to create a permission that is going to be checked.Examples:
(adaptClass=com.acme.*) (&(signer=\*,o=ACME,c=US)(adaptClass=com.acme.*)) (signer=\*,o=ACME,c=US)
When a signer key is used within the filter expression the signer value must escape the special filter chars ('*', '(', ')').
The name is specified as a filter expression. The filter gives access to the following attributes:
- signer - A Distinguished Name chain used to sign the exporting bundle. Wildcards in a DN are not matched according to the filter string rules, but according to the rules defined for a DN chain.
- location - The location of the exporting bundle.
- id - The bundle ID of the exporting bundle.
- name - The symbolic name of the exporting bundle.
- adaptClass - The name of the type to which an object can be adapted.
- 参数:
filter- A filter expression. Filter attribute names are processed in a case sensitive manner. A special value of"*"can be used to match all adaptations.actions-adapt.- 抛出:
java.lang.IllegalArgumentException- If the filter has an invalid syntax.
-
AdaptPermission
public AdaptPermission(java.lang.String adaptClass, Bundle adaptableBundle, java.lang.String actions)Creates a new requestedAdaptPermissionobject to be used by the code that must performcheckPermission.AdaptPermissionobjects created with this constructor cannot be added to anAdaptPermissionpermission collection.- 参数:
adaptClass- The name of the type to which an object can be adapted.adaptableBundle- The bundle associated with the object being adapted.actions-adapt.
-
-
方法详细资料
-
implies
public boolean implies(java.security.Permission p)
Determines if the specified permission is implied by this object.This method checks that the filter of the target is implied by the adapt class name of this object. The list of
AdaptPermissionactions must either match or allow for the list of the target object to imply the targetAdaptPermissionaction.- 覆盖:
implies在类中java.security.BasicPermission- 参数:
p- The requested permission.- 返回:
trueif the specified permission is implied by this object;falseotherwise.
-
getActions
public java.lang.String getActions()
Returns the canonical string representation of theAdaptPermissionactions.Always returns present
AdaptPermissionactions in the following order:adapt.- 覆盖:
getActions在类中java.security.BasicPermission- 返回:
- Canonical string representation of the
AdaptPermissionactions.
-
newPermissionCollection
public java.security.PermissionCollection newPermissionCollection()
Returns a newPermissionCollectionobject suitable for storingAdaptPermissionobjects.- 覆盖:
newPermissionCollection在类中java.security.BasicPermission- 返回:
- A new
PermissionCollectionobject.
-
equals
public boolean equals(java.lang.Object obj)
Determines the equality of twoAdaptPermissionobjects. This method checks that specified permission has the same name andAdaptPermissionactions as thisAdaptPermissionobject.- 覆盖:
equals在类中java.security.BasicPermission- 参数:
obj- The object to test for equality with thisAdaptPermissionobject.- 返回:
trueifobjis aAdaptPermission, and has the same name and actions as thisAdaptPermissionobject;falseotherwise.
-
hashCode
public int hashCode()
Returns the hash code value for this object.- 覆盖:
hashCode在类中java.security.BasicPermission- 返回:
- A hash code value for this object.
-
-