接口 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

相关文章

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 六大核心接口的形态学

详解Java如何向http/https接口发出请求

《详解Java如何向http/https接口发出请求》这篇文章主要为大家详细介绍了Java如何实现向http/https接口发出请求,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 用Java发送web请求所用到的包都在java.net下,在具体使用时可以用如下代码,你可以把它封装成一

Java后端接口中提取请求头中的Cookie和Token的方法

《Java后端接口中提取请求头中的Cookie和Token的方法》在现代Web开发中,HTTP请求头(Header)是客户端与服务器之间传递信息的重要方式之一,本文将详细介绍如何在Java后端(以Sp... 目录引言1. 背景1.1 什么是 HTTP 请求头?1.2 为什么需要提取请求头?2. 使用 Spr

Java 后端接口入参 - 联合前端VUE 使用AES完成入参出参加密解密

加密效果: 解密后的数据就是正常数据: 后端:使用的是spring-cloud框架,在gateway模块进行操作 <dependency><groupId>com.google.guava</groupId><artifactId>guava</artifactId><version>30.0-jre</version></dependency> 编写一个AES加密

消除安卓SDK更新时的“https://dl-ssl.google.com refused”异常的方法

消除安卓SDK更新时的“https://dl-ssl.google.com refused”异常的方法   消除安卓SDK更新时的“https://dl-ssl.google.com refused”异常的方法 [转载]原地址:http://blog.csdn.net/x605940745/article/details/17911115 消除SDK更新时的“

java线程深度解析(一)——java new 接口?匿名内部类给你答案

http://blog.csdn.net/daybreak1209/article/details/51305477 一、内部类 1、内部类初识 一般,一个类里主要包含类的方法和属性,但在Java中还提出在类中继续定义类(内部类)的概念。 内部类的定义:类的内部定义类 先来看一个实例 [html]  view plain copy pu