类 AdaptPermission

  • 所有已实现的接口:
    java.io.Serializable, java.security.Guard

    public final class AdaptPermission
    extends java.security.BasicPermission
    A bundle's authority to adapt an object to a type.

    AdaptPermission has one action: adapt.

    作者:
    $Id: 9f0866e633ce08566547b4955a2ece54c46944e0 $
    另请参阅:
    序列化表格
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      static java.lang.String ADAPT
      The action string initiate.
    • 构造器概要

      构造器 
      构造器 说明
      AdaptPermission​(java.lang.String filter, java.lang.String actions)
      Creates a new granted AdaptPermission object.
      AdaptPermission​(java.lang.String adaptClass, Bundle adaptableBundle, java.lang.String actions)
      Creates a new requested AdaptPermission object to be used by the code that must perform checkPermission.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      boolean equals​(java.lang.Object obj)
      Determines the equality of two AdaptPermission objects.
      java.lang.String getActions()
      Returns the canonical string representation of the AdaptPermission actions.
      int hashCode()
      Returns the hash code value for this object.
      boolean implies​(java.security.Permission p)
      Determines if the specified permission is implied by this object.
      java.security.PermissionCollection newPermissionCollection()
      Returns a new PermissionCollection object suitable for storing AdaptPermission objects.
      • 从类继承的方法 java.security.Permission

        checkGuard, getName, toString
      • 从类继承的方法 java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 字段详细资料

      • ADAPT

        public static final java.lang.String ADAPT
        The action string initiate.
        另请参阅:
        常量字段值
    • 构造器详细资料

      • AdaptPermission

        public AdaptPermission​(java.lang.String filter,
                               java.lang.String actions)
        Creates a new granted AdaptPermission object. 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 attribute names are processed in a case sensitive manner.
        参数:
        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 requested AdaptPermission object to be used by the code that must perform checkPermission. AdaptPermission objects created with this constructor cannot be added to an AdaptPermission permission 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 AdaptPermission actions must either match or allow for the list of the target object to imply the target AdaptPermission action.

        覆盖:
        implies 在类中 java.security.BasicPermission
        参数:
        p - The requested permission.
        返回:
        true if the specified permission is implied by this object; false otherwise.
      • getActions

        public java.lang.String getActions()
        Returns the canonical string representation of the AdaptPermission actions.

        Always returns present AdaptPermission actions in the following order: adapt.

        覆盖:
        getActions 在类中 java.security.BasicPermission
        返回:
        Canonical string representation of the AdaptPermission actions.
      • newPermissionCollection

        public java.security.PermissionCollection newPermissionCollection()
        Returns a new PermissionCollection object suitable for storing AdaptPermission objects.
        覆盖:
        newPermissionCollection 在类中 java.security.BasicPermission
        返回:
        A new PermissionCollection object.
      • equals

        public boolean equals​(java.lang.Object obj)
        Determines the equality of two AdaptPermission objects. This method checks that specified permission has the same name and AdaptPermission actions as this AdaptPermission object.
        覆盖:
        equals 在类中 java.security.BasicPermission
        参数:
        obj - The object to test for equality with this AdaptPermission object.
        返回:
        true if obj is a AdaptPermission, and has the same name and actions as this AdaptPermission object; false otherwise.
      • hashCode

        public int hashCode()
        Returns the hash code value for this object.
        覆盖:
        hashCode 在类中 java.security.BasicPermission
        返回:
        A hash code value for this object.