接口 PropertyAccessor

    • 方法详细资料

      • getSpecificTargetClasses

        @Nullable
        Class<?>[] getSpecificTargetClasses()
        Return an array of classes for which this resolver should be called.

        Returning null indicates this is a general resolver that can be called in an attempt to resolve a property on any type.

        返回:
        an array of classes that this resolver is suitable for (or null if a general resolver)
      • canRead

        boolean canRead​(EvaluationContext context,
                        @Nullable
                        Object target,
                        String name)
                 throws AccessException
        Called to determine if a resolver instance is able to access a specified property on a specified target object.
        参数:
        context - the evaluation context in which the access is being attempted
        target - the target object upon which the property is being accessed
        name - the name of the property being accessed
        返回:
        true if this resolver is able to read the property
        抛出:
        AccessException - if there is any problem determining whether the property can be read
      • canWrite

        boolean canWrite​(EvaluationContext context,
                         @Nullable
                         Object target,
                         String name)
                  throws AccessException
        Called to determine if a resolver instance is able to write to a specified property on a specified target object.
        参数:
        context - the evaluation context in which the access is being attempted
        target - the target object upon which the property is being accessed
        name - the name of the property being accessed
        返回:
        true if this resolver is able to write to the property
        抛出:
        AccessException - if there is any problem determining whether the property can be written to