热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ognl.Ognl.addDefaultContext()方法的使用及代码示例

本文整理了Java中ognl.Ognl.addDefaultContext()方法的一些代码示例,展示了Ognl.addDefaultContext()

本文整理了Java中ognl.Ognl.addDefaultContext()方法的一些代码示例,展示了Ognl.addDefaultContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ognl.addDefaultContext()方法的具体详情如下:
包路径:ognl.Ognl
类名称:Ognl
方法名:addDefaultContext

Ognl.addDefaultContext介绍

[英]Appends the standard naming context for evaluating an OGNL expression into the context given so that cached maps can be used as a context.
[中]将用于计算OGNL表达式的标准命名上下文附加到给定的上下文中,以便缓存的映射可以用作上下文。

代码示例

代码示例来源:origin: opensymphony/ognl

/**
* Appends the standard naming context for evaluating an OGNL expression
* into the context given so that cached maps can be used as a context.
*
* @param root the root of the object graph
* @param context the context to which OGNL context will be added.
* @return Context Map with the keys root and context
* set appropriately
*/
public static Map addDefaultContext( Object root, Map context )
{
return addDefaultContext( root, null, null, null, context );
}

代码示例来源:origin: opensymphony/ognl

/**
* Appends the standard naming context for evaluating an OGNL expression
* into the context given so that cached maps can be used as a context.
*
* @param root the root of the object graph
* @param context the context to which OGNL context will be added.
* @return Context Map with the keys root and context
* set appropriately
*/
public static Map addDefaultContext( Object root, ClassResolver classResolver, Map context )
{
return addDefaultContext(root, classResolver, null, null, context);
}

代码示例来源:origin: opensymphony/ognl

/**
* Appends the standard naming context for evaluating an OGNL expression
* into the context given so that cached maps can be used as a context.
*
* @param root the root of the object graph
* @param context the context to which OGNL context will be added.
* @return Context Map with the keys root and context
* set appropriately
*/
public static Map addDefaultContext( Object root, ClassResolver classResolver, TypeConverter converter, Map context )
{
return addDefaultContext(root, classResolver, converter, null, context);
}

代码示例来源:origin: ognl/ognl

public static boolean isSimpleProperty(Object tree, Map context)
throws OgnlException
{
return ((SimpleNode) tree).isSimpleProperty((OgnlContext) addDefaultContext(null, context));
}

代码示例来源:origin: ognl/ognl

public static boolean isSimpleNavigationChain(Object tree, Map context)
throws OgnlException
{
return ((SimpleNode) tree).isSimpleNavigationChain((OgnlContext) addDefaultContext(null, context));
}

代码示例来源:origin: opensymphony/ognl

/**
* Creates and returns a new standard naming context for evaluating an OGNL
* expression.
*
* @param root the root of the object graph
* @return a new Map with the keys root and context
* set appropriately
*/
public static Map createDefaultContext( Object root, ClassResolver classResolver, TypeConverter converter )
{
return addDefaultContext( root, classResolver, converter, null, new OgnlContext() );
}

代码示例来源:origin: opensymphony/ognl

/**
* Creates and returns a new standard naming context for evaluating an OGNL
* expression.
*
* @param root the root of the object graph
* @return a new Map with the keys root and context
* set appropriately
*/
public static Map createDefaultContext( Object root, ClassResolver classResolver, TypeConverter converter, MemberAccess memberAccess )
{
return addDefaultContext( root, classResolver, converter, memberAccess, new OgnlContext() );
}

代码示例来源:origin: opensymphony/ognl

/**
* Creates and returns a new standard naming context for evaluating an OGNL
* expression.
*
* @param root the root of the object graph
* @return a new Map with the keys root and context
* set appropriately
*/
public static Map createDefaultContext( Object root )
{
return addDefaultContext( root, null, null, null, new OgnlContext() );
}

代码示例来源:origin: opensymphony/ognl

/**
* Creates and returns a new standard naming context for evaluating an OGNL
* expression.
*
* @param root the root of the object graph
* @return a new OgnlContext with the keys root and context
* set appropriately
*/
public static Map createDefaultContext( Object root, ClassResolver classResolver )
{
return addDefaultContext( root, classResolver, null, null, new OgnlContext() );
}

代码示例来源:origin: jkuhnert/ognl

public static boolean isSimpleProperty(Object tree, Map context)
throws OgnlException
{
return ((SimpleNode) tree).isSimpleProperty((OgnlContext) addDefaultContext(null, context));
}

代码示例来源:origin: jkuhnert/ognl

public static boolean isSimpleNavigationChain(Object tree, Map context)
throws OgnlException
{
return ((SimpleNode) tree).isSimpleNavigationChain((OgnlContext) addDefaultContext(null, context));
}

代码示例来源:origin: opensymphony/ognl

public static boolean isSimpleProperty( Object tree, Map context ) throws OgnlException
{
return ((SimpleNode)tree).isSimpleProperty( (OgnlContext)addDefaultContext( null, context ) );
}

代码示例来源:origin: opensymphony/ognl

public static boolean isConstant( Object tree, Map context ) throws OgnlException
{
return ((SimpleNode)tree).isConstant( (OgnlContext)addDefaultContext( null, context ) );
}

代码示例来源:origin: opensymphony/ognl

public static boolean isSimpleNavigationChain( Object tree, Map context ) throws OgnlException
{
return ((SimpleNode)tree).isSimpleNavigationChain( (OgnlContext)addDefaultContext( null, context ) );
}

代码示例来源:origin: ognl/ognl

/**
* Creates and returns a new standard naming context for evaluating an OGNL expression.
*
* @param root
* the root of the object graph
* @return a new Map with the keys root and context set
* appropriately
*
* @deprecated it will be removed soon
*/
@Deprecated
public static Map createDefaultContext(Object root)
{
return addDefaultContext(root, null, null, null, new OgnlContext(null, null, null));
}

代码示例来源:origin: ognl/ognl

/**
* Creates and returns a new standard naming context for evaluating an OGNL expression.
*
* @param root
* The root of the object graph.
* @param memberAccess
* Java security handling object to determine semantics for accessing normally private/protected
* methods / fields.
* @return a new Map with the keys root and context set
* appropriately
*/
public static Map createDefaultContext(Object root, MemberAccess memberAccess)
{
return addDefaultContext(root, memberAccess, null, null, new OgnlContext(null, null, memberAccess));
}

代码示例来源:origin: jkuhnert/ognl

/**
* Creates and returns a new standard naming context for evaluating an OGNL expression.
*
* @param root
* the root of the object graph
* @return a new Map with the keys root and context set
* appropriately
*
* @deprecated it will be removed soon
*/
@Deprecated
public static Map createDefaultContext(Object root)
{
return addDefaultContext(root, null, null, null, new OgnlContext(null, null, null));
}

代码示例来源:origin: jkuhnert/ognl

/**
* Creates and returns a new standard naming context for evaluating an OGNL expression.
*
* @param root
* The root of the object graph.
* @param memberAccess
* Java security handling object to determine semantics for accessing normally private/protected
* methods / fields.
* @return a new Map with the keys root and context set
* appropriately
*/
public static Map createDefaultContext(Object root, MemberAccess memberAccess)
{
return addDefaultContext(root, memberAccess, null, null, new OgnlContext(null, null, memberAccess));
}

代码示例来源:origin: org.zkoss.zk/zkmax

/** Returns an OGNL context for the specified XEL context.
*/
public static Map getContext(XelContext ctx) {
final FunctionMapper mapper = ctx.getFunctionMapper();
return Ognl.addDefaultContext(null,
mapper != null ? new MapperClassResolver(mapper): null,
Collections.EMPTY_MAP);
//Note: we always pass null as the context, since
//we use ResolverAccessor as the root
}
/** Returns the root object.

代码示例来源:origin: org.seasar.container/s2-framework

static Map addClassResolverIfNecessary(Map ctx, Object root) {
if (root instanceof S2Container) {
S2Container cOntainer= (S2Container) root;
ClassLoader classLoader = container.getClassLoader();
if (classLoader != null) {
ClassResolverImpl classResolver = new ClassResolverImpl(
classLoader);
if (ctx == null) {
ctx = Ognl.createDefaultContext(root, classResolver);
} else {
ctx = Ognl.addDefaultContext(root, classResolver, ctx);
}
}
}
return ctx;
}

推荐阅读
  • JDK源码学习之HashTable(附带面试题)的学习笔记
    本文介绍了JDK源码学习之HashTable(附带面试题)的学习笔记,包括HashTable的定义、数据类型、与HashMap的关系和区别。文章提供了干货,并附带了其他相关主题的学习笔记。 ... [详细]
  • 海马s5近光灯能否直接更换为H7?
    本文主要介绍了海马s5车型的近光灯是否可以直接更换为H7灯泡,并提供了完整的教程下载地址。此外,还详细讲解了DSP功能函数中的数据拷贝、数据填充和浮点数转换为定点数的相关内容。 ... [详细]
  • 本文整理了Java面试中常见的问题及相关概念的解析,包括HashMap中为什么重写equals还要重写hashcode、map的分类和常见情况、final关键字的用法、Synchronized和lock的区别、volatile的介绍、Syncronized锁的作用、构造函数和构造函数重载的概念、方法覆盖和方法重载的区别、反射获取和设置对象私有字段的值的方法、通过反射创建对象的方式以及内部类的详解。 ... [详细]
  • HashMap的相关问题及其底层数据结构和操作流程
    本文介绍了关于HashMap的相关问题,包括其底层数据结构、JDK1.7和JDK1.8的差异、红黑树的使用、扩容和树化的条件、退化为链表的情况、索引的计算方法、hashcode和hash()方法的作用、数组容量的选择、Put方法的流程以及并发问题下的操作。文章还提到了扩容死链和数据错乱的问题,并探讨了key的设计要求。对于对Java面试中的HashMap问题感兴趣的读者,本文将为您提供一些有用的技术和经验。 ... [详细]
  • Java太阳系小游戏分析和源码详解
    本文介绍了一个基于Java的太阳系小游戏的分析和源码详解。通过对面向对象的知识的学习和实践,作者实现了太阳系各行星绕太阳转的效果。文章详细介绍了游戏的设计思路和源码结构,包括工具类、常量、图片加载、面板等。通过这个小游戏的制作,读者可以巩固和应用所学的知识,如类的继承、方法的重载与重写、多态和封装等。 ... [详细]
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • Java序列化对象传给PHP的方法及原理解析
    本文介绍了Java序列化对象传给PHP的方法及原理,包括Java对象传递的方式、序列化的方式、PHP中的序列化用法介绍、Java是否能反序列化PHP的数据、Java序列化的原理以及解决Java序列化中的问题。同时还解释了序列化的概念和作用,以及代码执行序列化所需要的权限。最后指出,序列化会将对象实例的所有字段都进行序列化,使得数据能够被表示为实例的序列化数据,但只有能够解释该格式的代码才能够确定数据的内容。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • 使用在线工具jsonschema2pojo根据json生成java对象
    本文介绍了使用在线工具jsonschema2pojo根据json生成java对象的方法。通过该工具,用户只需将json字符串复制到输入框中,即可自动将其转换成java对象。该工具还能解析列表式的json数据,并将嵌套在内层的对象也解析出来。本文以请求github的api为例,展示了使用该工具的步骤和效果。 ... [详细]
  • 个人学习使用:谨慎参考1Client类importcom.thoughtworks.gauge.Step;importcom.thoughtworks.gauge.T ... [详细]
  • ALTERTABLE通过更改、添加、除去列和约束,或者通过启用或禁用约束和触发器来更改表的定义。语法ALTERTABLEtable{[ALTERCOLUMNcolu ... [详细]
  • 前景:当UI一个查询条件为多项选择,或录入多个条件的时候,比如查询所有名称里面包含以下动态条件,需要模糊查询里面每一项时比如是这样一个数组条件:newstring[]{兴业银行, ... [详细]
  • 本文介绍了如何使用Express App提供静态文件,同时提到了一些不需要使用的文件,如package.json和/.ssh/known_hosts,并解释了为什么app.get('*')无法捕获所有请求以及为什么app.use(express.static(__dirname))可能会提供不需要的文件。 ... [详细]
  • 先看官方文档TheJavaTutorialshavebeenwrittenforJDK8.Examplesandpracticesdescribedinthispagedontta ... [详细]
  • Spring框架《一》简介
    Spring框架《一》1.Spring概述1.1简介1.2Spring模板二、IOC容器和Bean1.IOC和DI简介2.三种通过类型获取bean3.给bean的属性赋值3.1依赖 ... [详细]
author-avatar
土土不怕苦_402
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有