类 EnvironmentAccessor

    • 方法详细资料

      • getSpecificTargetClasses

        public Class<?>[] getSpecificTargetClasses()
        从接口复制的说明: PropertyAccessor
        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.

        指定者:
        getSpecificTargetClasses 在接口中 PropertyAccessor
        返回:
        an array of classes that this resolver is suitable for (or null if a general resolver)
      • read

        public TypedValue read​(EvaluationContext context,
                               @Nullable
                               Object target,
                               String name)
                        throws AccessException
        Access the given target object by resolving the given property name against the given target environment.
        指定者:
        read 在接口中 PropertyAccessor
        参数:
        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
        返回:
        a TypedValue object wrapping the property value read and a type descriptor for it
        抛出:
        AccessException - if there is any problem accessing the property value
      • canWrite

        public boolean canWrite​(EvaluationContext context,
                                @Nullable
                                Object target,
                                String name)
                         throws AccessException
        Read-only: returns false.
        指定者:
        canWrite 在接口中 PropertyAccessor
        参数:
        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