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

相关文章

SpringBoot+Redis防止接口重复提交问题

《SpringBoot+Redis防止接口重复提交问题》:本文主要介绍SpringBoot+Redis防止接口重复提交问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不... 目录前言实现思路代码示例测试总结前言在项目的使用使用过程中,经常会出现某些操作在短时间内频繁提交。例

springboot下载接口限速功能实现

《springboot下载接口限速功能实现》通过Redis统计并发数动态调整每个用户带宽,核心逻辑为每秒读取并发送限定数据量,防止单用户占用过多资源,确保整体下载均衡且高效,本文给大家介绍spring... 目录 一、整体目标 二、涉及的主要类/方法✅ 三、核心流程图解(简化) 四、关键代码详解1️⃣ 设置

spring中的ImportSelector接口示例详解

《spring中的ImportSelector接口示例详解》Spring的ImportSelector接口用于动态选择配置类,实现条件化和模块化配置,关键方法selectImports根据注解信息返回... 目录一、核心作用二、关键方法三、扩展功能四、使用示例五、工作原理六、应用场景七、自定义实现Impor

MybatisPlus service接口功能介绍

《MybatisPlusservice接口功能介绍》:本文主要介绍MybatisPlusservice接口功能介绍,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友... 目录Service接口基本用法进阶用法总结:Lambda方法Service接口基本用法MyBATisP

Java中的Closeable接口及常见问题

《Java中的Closeable接口及常见问题》Closeable是Java中的一个标记接口,用于表示可以被关闭的对象,它定义了一个标准的方法来释放对象占用的系统资源,下面给大家介绍Java中的Clo... 目录1. Closeable接口概述2. 主要用途3. 实现类4. 使用方法5. 实现自定义Clos

java对接第三方接口的三种实现方式

《java对接第三方接口的三种实现方式》:本文主要介绍java对接第三方接口的三种实现方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录HttpURLConnection调用方法CloseableHttpClient调用RestTemplate调用总结在日常工作

Java 的 Condition 接口与等待通知机制详解

《Java的Condition接口与等待通知机制详解》在Java并发编程里,实现线程间的协作与同步是极为关键的任务,本文将深入探究Condition接口及其背后的等待通知机制,感兴趣的朋友一起看... 目录一、引言二、Condition 接口概述2.1 基本概念2.2 与 Object 类等待通知方法的区别

SpringBoot实现接口数据加解密的三种实战方案

《SpringBoot实现接口数据加解密的三种实战方案》在金融支付、用户隐私信息传输等场景中,接口数据若以明文传输,极易被中间人攻击窃取,SpringBoot提供了多种优雅的加解密实现方案,本文将从原... 目录一、为什么需要接口数据加解密?二、核心加解密算法选择1. 对称加密(AES)2. 非对称加密(R

Java对接Dify API接口的完整流程

《Java对接DifyAPI接口的完整流程》Dify是一款AI应用开发平台,提供多种自然语言处理能力,通过调用Dify开放API,开发者可以快速集成智能对话、文本生成等功能到自己的Java应用中,本... 目录Java对接Dify API接口完整指南一、Dify API简介二、准备工作三、基础对接实现1.

Java controller接口出入参时间序列化转换操作方法(两种)

《Javacontroller接口出入参时间序列化转换操作方法(两种)》:本文主要介绍Javacontroller接口出入参时间序列化转换操作方法,本文给大家列举两种简单方法,感兴趣的朋友一起看... 目录方式一、使用注解方式二、统一配置场景:在controller编写的接口,在前后端交互过程中一般都会涉及