接口 ValueStack:com.opensymphony.xwork2.util

2024-06-12 06:58

本文主要是介绍接口 ValueStack:com.opensymphony.xwork2.util,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

相关阅读:

在 Struts 2 中自定义支持 OGNL 的标签:http://blog.csdn.net/ieayoio/article/details/49721587

API:http://www.boyunjian.com/javadoc/com.opensymphony/xwork-core/2.1.6/_/com/opensymphony/xwork2/util/ValueStack.html

com.opensymphony.xwork2.util

接口 ValueStack

  • 所有已知实现类:
    OgnlValueStack


    public interface ValueStack
    ValueStack allows multiple beans to be pushed in and dynamic EL expressions to be evaluated against it. When evaluating an expression, the stack will be searched down the stack, from the latest objects pushed in to the earliest, looking for a bean with a getter or setter for the given property or a method of the given name (depending on the expression being evaluated).
    • 字段概要

      字段  
      限定符和类型 字段和说明
      static java.lang.String REPORT_ERRORS_ON_NO_PROP 
      static java.lang.String VALUE_STACK 
    • 方法概要

      方法  
      限定符和类型 方法和说明
      java.lang.String findString(java.lang.String expr) 
      java.lang.String findString(java.lang.String expr, boolean throwExceptionOnFailure) 
      java.lang.Object findValue(java.lang.String expr)
      Find a value by evaluating the given expression against the stack in the default search order.
      java.lang.Object findValue(java.lang.String expr, boolean throwExceptionOnFailure) 
      java.lang.Object findValue(java.lang.String expr, java.lang.Class asType)
      Find a value by evaluating the given expression against the stack in the default search order.
      java.lang.Object findValue(java.lang.String expr, java.lang.Class asType, boolean throwExceptionOnFailure) 
      java.util.Map<java.lang.String,java.lang.Object> getContext()
      Gets the context for this value stack.
      java.util.Map<java.lang.Object,java.lang.Object> getExprOverrides()
      Gets the override map if anyone exists.
      CompoundRoot getRoot()
      Get the CompoundRoot which holds the objects pushed onto the stack
      java.lang.Object peek()
      Get the object on the top of the stack  without changing the stack.
      java.lang.Object pop()
      Get the object on the top of the stack and  remove it from the stack.
      void push(java.lang.Object o)
      Put this object onto the top of the stack
      void set(java.lang.String key, java.lang.Object o)
      Sets an object on the stack with the given key so it is retrievable by  findValue(String), findValue(String, Class)
      void setDefaultType(java.lang.Class defaultType)
      Sets the default type to convert to if no type is provided when getting a value.
      void setExprOverrides(java.util.Map<java.lang.Object,java.lang.Object> overrides)
      Set a override map containing  key -> values that takes precedent when doing find operations on the ValueStack.
      void setValue(java.lang.String expr, java.lang.Object value)
      Attempts to set a property on a bean in the stack with the given expression using the default search order.
      void setValue(java.lang.String expr, java.lang.Object value, boolean throwExceptionOnFailure)
      Attempts to set a property on a bean in the stack with the given expression using the default search order.
      int size()
      Get the number of objects in the stack
    • 方法详细资料

      • getContext
        java.util.Map<java.lang.String,java.lang.Object> getContext()
        Gets the context for this value stack. The context holds all the information in the value stack and it's surroundings.
        返回:
        the context.
      • setDefaultType
        void setDefaultType(java.lang.Class defaultType)
        Sets the default type to convert to if no type is provided when getting a value.
        参数:
        defaultType - the new default type
      • setExprOverrides
        void setExprOverrides(java.util.Map<java.lang.Object,java.lang.Object> overrides)
        Set a override map containing  key -> values that takes precedent when doing find operations on the ValueStack.

        See the unit test for ValueStackTest for examples.
        参数:
        overrides - overrides map.
      • getExprOverrides
        java.util.Map<java.lang.Object,java.lang.Object> getExprOverrides()
        Gets the override map if anyone exists.
        返回:
        the override map,  null if not set.
      • getRoot
        CompoundRoot getRoot()
        Get the CompoundRoot which holds the objects pushed onto the stack
        返回:
        the root
      • setValue
        void setValue(java.lang.String expr,java.lang.Object value)
        Attempts to set a property on a bean in the stack with the given expression using the default search order.
        参数:
        expr - the expression defining the path to the property to be set.
        value - the value to be set into the named property
      • setValue
        void setValue(java.lang.String expr,java.lang.Object value,boolean throwExceptionOnFailure)
        Attempts to set a property on a bean in the stack with the given expression using the default search order.
        参数:
        expr - the expression defining the path to the property to be set.
        value - the value to be set into the named property
        throwExceptionOnFailure - a flag to tell whether an exception should be thrown if there is no property with the given name.
      • findString
        java.lang.String findString(java.lang.String expr)
      • findString
        java.lang.String findString(java.lang.String expr,boolean throwExceptionOnFailure)
      • findValue
        java.lang.Object findValue(java.lang.String expr)
        Find a value by evaluating the given expression against the stack in the default search order.
        参数:
        expr - the expression giving the path of properties to navigate to find the property value to return
        返回:
        the result of evaluating the expression
      • findValue
        java.lang.Object findValue(java.lang.String expr,boolean throwExceptionOnFailure)
      • findValue
        java.lang.Object findValue(java.lang.String expr,java.lang.Class asType)
        Find a value by evaluating the given expression against the stack in the default search order.
        参数:
        expr - the expression giving the path of properties to navigate to find the property value to return
        asType - the type to convert the return value to
        返回:
        the result of evaluating the expression
      • findValue
        java.lang.Object findValue(java.lang.String expr,java.lang.Class asType,boolean throwExceptionOnFailure)
      • peek
        java.lang.Object peek()
        Get the object on the top of the stack  without changing the stack.
        返回:
        the object on the top.
        另请参阅:
        CompoundRoot.peek()
      • pop
        java.lang.Object pop()
        Get the object on the top of the stack and  remove it from the stack.
        返回:
        the object on the top of the stack
        另请参阅:
        CompoundRoot.pop()
      • push
        void push(java.lang.Object o)
        Put this object onto the top of the stack
        参数:
        o - the object to be pushed onto the stack
        另请参阅:
        CompoundRoot.push(Object)
      • set
        void set(java.lang.String key,java.lang.Object o)
        Sets an object on the stack with the given key so it is retrievable by  findValue(String)findValue(String, Class)
        参数:
        key - the key
        o - the object
      • size
        int size()
        Get the number of objects in the stack
        返回:
        the number of objects in the stack











这篇关于接口 ValueStack:com.opensymphony.xwork2.util的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1053500

相关文章

go中空接口的具体使用

《go中空接口的具体使用》空接口是一种特殊的接口类型,它不包含任何方法,本文主要介绍了go中空接口的具体使用,具有一定的参考价值,感兴趣的可以了解一下... 目录接口-空接口1. 什么是空接口?2. 如何使用空接口?第一,第二,第三,3. 空接口几个要注意的坑坑1:坑2:坑3:接口-空接口1. 什么是空接

如何用java对接微信小程序下单后的发货接口

《如何用java对接微信小程序下单后的发货接口》:本文主要介绍在微信小程序后台实现发货通知的步骤,包括获取Access_token、使用RestTemplate调用发货接口、处理AccessTok... 目录配置参数 调用代码获取Access_token调用发货的接口类注意点总结配置参数 首先需要获取Ac

讯飞webapi语音识别接口调用示例代码(python)

《讯飞webapi语音识别接口调用示例代码(python)》:本文主要介绍如何使用Python3调用讯飞WebAPI语音识别接口,重点解决了在处理语音识别结果时判断是否为最后一帧的问题,通过运行代... 目录前言一、环境二、引入库三、代码实例四、运行结果五、总结前言基于python3 讯飞webAPI语音

MyBatis-Plus中Service接口的lambdaUpdate用法及实例分析

《MyBatis-Plus中Service接口的lambdaUpdate用法及实例分析》本文将详细讲解MyBatis-Plus中的lambdaUpdate用法,并提供丰富的案例来帮助读者更好地理解和应... 目录深入探索MyBATis-Plus中Service接口的lambdaUpdate用法及示例案例背景

Java8需要知道的4个函数式接口简单教程

《Java8需要知道的4个函数式接口简单教程》:本文主要介绍Java8中引入的函数式接口,包括Consumer、Supplier、Predicate和Function,以及它们的用法和特点,文中... 目录什么是函数是接口?Consumer接口定义核心特点注意事项常见用法1.基本用法2.结合andThen链

Deepseek R1模型本地化部署+API接口调用详细教程(释放AI生产力)

《DeepseekR1模型本地化部署+API接口调用详细教程(释放AI生产力)》本文介绍了本地部署DeepSeekR1模型和通过API调用将其集成到VSCode中的过程,作者详细步骤展示了如何下载和... 目录前言一、deepseek R1模型与chatGPT o1系列模型对比二、本地部署步骤1.安装oll

MyBatis-Flex BaseMapper的接口基本用法小结

《MyBatis-FlexBaseMapper的接口基本用法小结》本文主要介绍了MyBatis-FlexBaseMapper的接口基本用法小结,文中通过示例代码介绍的非常详细,对大家的学习或者工作具... 目录MyBATis-Flex简单介绍特性基础方法INSERT① insert② insertSelec

Spring排序机制之接口与注解的使用方法

《Spring排序机制之接口与注解的使用方法》本文介绍了Spring中多种排序机制,包括Ordered接口、PriorityOrdered接口、@Order注解和@Priority注解,提供了详细示例... 目录一、Spring 排序的需求场景二、Spring 中的排序机制1、Ordered 接口2、Pri

Idea实现接口的方法上无法添加@Override注解的解决方案

《Idea实现接口的方法上无法添加@Override注解的解决方案》文章介绍了在IDEA中实现接口方法时无法添加@Override注解的问题及其解决方法,主要步骤包括更改项目结构中的Languagel... 目录Idea实现接China编程口的方法上无法添加@javascriptOverride注解错误原因解决方

Java function函数式接口的使用方法与实例

《Javafunction函数式接口的使用方法与实例》:本文主要介绍Javafunction函数式接口的使用方法与实例,函数式接口如一支未完成的诗篇,用Lambda表达式作韵脚,将代码的机械美感... 目录引言-当代码遇见诗性一、函数式接口的生物学解构1.1 函数式接口的基因密码1.2 六大核心接口的形态学